From 67de67a1062eae7bbd9bc1ac228f75263f5ac104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 26 Jul 2023 03:40:09 +0200 Subject: chore: update chrono dependency (#19943) Pulled from https://github.com/denoland/deno/pull/19747 Authored-by: Cooper Benson --- cli/util/time.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cli/util') diff --git a/cli/util/time.rs b/cli/util/time.rs index 9c5b48b57..5c1a89d48 100644 --- a/cli/util/time.rs +++ b/cli/util/time.rs @@ -14,9 +14,10 @@ pub fn utc_now() -> chrono::DateTime { let now = std::time::SystemTime::now() .duration_since(std::time::UNIX_EPOCH) .expect("system time before Unix epoch"); - let naive = chrono::NaiveDateTime::from_timestamp( + let naive = chrono::NaiveDateTime::from_timestamp_opt( now.as_secs() as i64, now.subsec_nanos(), - ); + ) + .unwrap(); chrono::DateTime::from_utc(naive, chrono::Utc) } -- cgit v1.2.3