-
Notifications
You must be signed in to change notification settings - Fork 543
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_millis #430
Comments
This method is missing |
GopherJ
changed the title
NaiveDateTime::from_timestamp_millis
NaiveDateTime::from_millis
Jun 1, 2020
It's super ugly to do: NaiveDateTime::from_timestamp(
(timestamp / 1000) as i64,
0,
) |
Doing this results in reduced precision, as millis from the last second are lost. Do this instead (then it gets even more verbose). let secs = millis / 1000;
let nsecs = (millis % 1000) as u32 * 1_000_000;
NaiveDateTime::from_timestamp_opt(secs, nsecs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: