1
0
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:
Emil Ernerfeldt
2026-03-24 13:58:21 +01:00
committed by GitHub
parent 5d5f0dedcc
commit a12d18d9bd
12 changed files with 88 additions and 155 deletions

View File

@@ -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.