-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be0dc25
commit 4ba28b8
Showing
10 changed files
with
69 additions
and
68 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// Copyright 2023 the Deno authors. All rights reserved. MIT license. | ||
|
||
mod codec; | ||
mod interface; | ||
mod protobuf; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2023 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"); | ||
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2023 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"); | ||
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) | ||
} |