Skip to content

Commit

Permalink
change UTC::now() documentation to "date and time" (chronotope#647)
Browse files Browse the repository at this point in the history
  • Loading branch information
ModProg authored and pickfire committed Jul 5, 2022
1 parent 1e610a7 commit 2165b15
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -19,6 +19,8 @@ Versions with only mechanical changes will be omitted from the following list.
* Implement `DurationRound` for `NaiveDateTime`
* Correct build for wasm32-unknown-emscripten target
* Add `DateTime::from_local()` to construct from given local date and time (#572)
* Correct build for wasm32-unknown-emscripten target (#568)
* Change `Local::now()` and `Utc::now()` documentation from "current date" to "current date and time" (#647)

## 0.4.19

Expand Down
4 changes: 2 additions & 2 deletions src/offset/local.rs
Expand Up @@ -96,13 +96,13 @@ impl Local {
Local::now().date()
}

/// Returns a `DateTime` which corresponds to the current date.
/// Returns a `DateTime` which corresponds to the current date and time.
#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"), feature = "wasmbind")))]
pub fn now() -> DateTime<Local> {
tm_to_datetime(Timespec::now().local())
}

/// Returns a `DateTime` which corresponds to the current date.
/// Returns a `DateTime` which corresponds to the current date and time.
#[cfg(all(target_arch = "wasm32", not(target_os = "wasi"), feature = "wasmbind"))]
pub fn now() -> DateTime<Local> {
use super::Utc;
Expand Down
4 changes: 2 additions & 2 deletions src/offset/utc.rs
Expand Up @@ -42,7 +42,7 @@ impl Utc {
Utc::now().date()
}

/// Returns a `DateTime` which corresponds to the current date.
/// Returns a `DateTime` which corresponds to the current date and time.
#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"), feature = "wasmbind")))]
pub fn now() -> DateTime<Utc> {
let now =
Expand All @@ -51,7 +51,7 @@ impl Utc {
DateTime::from_utc(naive, Utc)
}

/// Returns a `DateTime` which corresponds to the current date.
/// Returns a `DateTime` which corresponds to the current date and time.
#[cfg(all(target_arch = "wasm32", not(target_os = "wasi"), feature = "wasmbind"))]
pub fn now() -> DateTime<Utc> {
let now = js_sys::Date::new_0();
Expand Down

0 comments on commit 2165b15

Please sign in to comment.