replace deprecated NaiveDateTime::from_timestamp

This commit is contained in:
sourceturner
2026-04-19 21:54:41 +02:00
committed by sourceturner
parent 292fd9e50b
commit 1f584a3943
+3 -1
View File
@@ -769,7 +769,9 @@ fn time_zone() -> Tz {
fn now() -> NaiveDateTime {
let mut now = timespec::default();
if Sys::clock_gettime(CLOCK_REALTIME, Out::from_mut(&mut now)).is_ok() {}; // TODO what to do if Err?
NaiveDateTime::from_timestamp(now.tv_sec, now.tv_nsec as _)
DateTime::from_timestamp(now.tv_sec, now.tv_nsec as _)
.unwrap_or_default()
.naive_local()
}
#[inline(always)]