Created
September 5, 2023 16:13
-
-
Save matthewjberger/f4de54df00cd0a183fd1fbad380016f1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Time of day as seconds since midnight. Used for clock in demo app. | |
pub(crate) fn seconds_since_midnight() -> f64 { | |
use chrono::Timelike; | |
let time = chrono::Local::now().time(); | |
time.num_seconds_from_midnight() as f64 + 1e-9 * (time.nanosecond() as f64) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment