Skip to content

Commit

Permalink
change UTC::now() documentation to "date and time" (#647)
Browse files Browse the repository at this point in the history
  • Loading branch information
ModProg authored and Milo123459 committed Mar 6, 2022
1 parent 42d7c77 commit 949c6ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Versions with only mechanical changes will be omitted from the following list.
* Add `DateTime::from_local()` to construct from given local date and time (#572)
* Correct build for wasm32-unknown-emscripten target (#568)
* Bump time (#639)
* 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 949c6ea

Please sign in to comment.