mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 23:00:04 -04:00
Replace chrono with jiff (#8008)
`jiff` is more modern, and seem to be where the ecosystem is heading.
This commit is contained in:
@@ -9,9 +9,10 @@ pub use wrap_app::{Anchor, WrapApp};
|
||||
|
||||
/// Time of day as seconds since midnight. Used for clock in demo app.
|
||||
pub(crate) fn seconds_since_midnight() -> f64 {
|
||||
use chrono::Timelike as _;
|
||||
let time = chrono::Local::now().time();
|
||||
time.num_seconds_from_midnight() as f64 + 1e-9 * (time.nanosecond() as f64)
|
||||
jiff::Zoned::now()
|
||||
.time()
|
||||
.duration_since(jiff::civil::Time::midnight())
|
||||
.as_secs_f64()
|
||||
}
|
||||
|
||||
/// Trait that wraps different parts of the demo app.
|
||||
|
||||
Reference in New Issue
Block a user