diff options
Diffstat (limited to 'ext/kv/time.rs')
-rw-r--r-- | ext/kv/time.rs | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/ext/kv/time.rs b/ext/kv/time.rs deleted file mode 100644 index 3a5565332..000000000 --- a/ext/kv/time.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -/// Identical to chrono::Utc::now() but without the system "clock" -/// feature flag. -/// -/// The "clock" feature flag pulls in the "iana-time-zone" crate -/// which links to macOS's "CoreFoundation" framework which increases -/// startup time for the CLI. -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"); - chrono::DateTime::from_timestamp(now.as_secs() as i64, now.subsec_nanos()) - .unwrap() -} |