Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NaiveDateTime::from_timestamp_millis(_opt) #818

Merged
merged 5 commits into from Sep 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/naive/datetime/mod.rs
Expand Up @@ -126,12 +126,11 @@ impl NaiveDateTime {
let datetime = NaiveDateTime::from_timestamp_opt(secs, nsecs);
datetime.expect("invalid or out-of-range datetime")
}

/// Makes a new `NaiveDateTime` corresponding to a UTC date and time,
/// from the number of milliseconds
/// since the midnight UTC on January 1, 1970 (aka "UNIX timestamp").
/// Creates a new [NaiveDateTime] from milliseconds since UNIX Epoch.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both here and in the next line, I think prefixing "UNIX" with "the" ("the UNIX epoch") would read better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done,

///
/// UNIX epoch starts on midnight, January 1, 1970, UTC.
///
/// Returns `None` on the out-of-range number of milliseconds and/or invalid nanosecond.
/// Returns `None` on an out-of-range number of milliseconds.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should ditch the prefix space here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

///
/// # Example
///
Expand Down