From 22b19dfcf276b1228d7e1cdd407b27014a7eae25 Mon Sep 17 00:00:00 2001 From: Roland Fredenhagen Date: Tue, 8 Feb 2022 12:41:54 +0100 Subject: [PATCH 1/2] change UTC::now() documentation to "date and time" At least I was confused for a moment reading that it returns the current date, looking at it in the documentation. --- src/offset/utc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/offset/utc.rs b/src/offset/utc.rs index aff86073d2..3be9bfb59a 100644 --- a/src/offset/utc.rs +++ b/src/offset/utc.rs @@ -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 { let now = js_sys::Date::new_0(); From 80e2eb3a8da7d0e291f2f4e1961cac0ac77c86e3 Mon Sep 17 00:00:00 2001 From: Roland Fredenhagen Date: Tue, 8 Feb 2022 12:50:23 +0100 Subject: [PATCH 2/2] Complete change and add to CHANGELOG --- CHANGELOG.md | 1 + src/offset/local.rs | 4 ++-- src/offset/utc.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d92797e587..1cfecebadd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Versions with only mechanical changes will be omitted from the following list. * Implement `DurationRound` for `NaiveDateTime` * 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 diff --git a/src/offset/local.rs b/src/offset/local.rs index 8ee5848b5e..deb3d681fe 100644 --- a/src/offset/local.rs +++ b/src/offset/local.rs @@ -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 { 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 { use super::Utc; diff --git a/src/offset/utc.rs b/src/offset/utc.rs index 3be9bfb59a..b094e57c4d 100644 --- a/src/offset/utc.rs +++ b/src/offset/utc.rs @@ -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 { let now =