summaryrefslogtreecommitdiff
path: root/ext/cron
diff options
context:
space:
mode:
Diffstat (limited to 'ext/cron')
-rw-r--r--ext/cron/time.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/ext/cron/time.rs b/ext/cron/time.rs
index c39882f7b..3a5565332 100644
--- a/ext/cron/time.rs
+++ b/ext/cron/time.rs
@@ -10,10 +10,6 @@ pub fn utc_now() -> chrono::DateTime<chrono::Utc> {
let now = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.expect("system time before Unix epoch");
- let naive = chrono::NaiveDateTime::from_timestamp_opt(
- now.as_secs() as i64,
- now.subsec_nanos(),
- )
- .unwrap();
- chrono::DateTime::from_naive_utc_and_offset(naive, chrono::Utc)
+ chrono::DateTime::from_timestamp(now.as_secs() as i64, now.subsec_nanos())
+ .unwrap()
}