diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-07-26 03:40:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 01:40:09 +0000 |
commit | 67de67a1062eae7bbd9bc1ac228f75263f5ac104 (patch) | |
tree | de8ce9153b3c7f0662cc91bb4877c9db09d41e77 /cli/util/time.rs | |
parent | 28f6c400051a91d4125e7b589821655581ae49fa (diff) |
chore: update chrono dependency (#19943)
Pulled from https://github.com/denoland/deno/pull/19747
Authored-by: Cooper Benson <skycoop@gmail.com>
Diffstat (limited to 'cli/util/time.rs')
-rw-r--r-- | cli/util/time.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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<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( + let naive = chrono::NaiveDateTime::from_timestamp_opt( now.as_secs() as i64, now.subsec_nanos(), - ); + ) + .unwrap(); chrono::DateTime::from_utc(naive, chrono::Utc) } |