diff --git a/Cargo.toml b/Cargo.toml index b5298f8bc..fdd9521af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,5 +40,6 @@ web-time = { version = "1.1.0", optional = true } [features] log = ["dep:log"] experimental = ["tzdb"] +now = ["std", "dep:web-time"] tzdb = ["dep:tzif", "std", "dep:jiff-tzdb", "dep:combine"] std = [] diff --git a/src/components/mod.rs b/src/components/mod.rs index c76f17bf5..3cf17e0fd 100644 --- a/src/components/mod.rs +++ b/src/components/mod.rs @@ -18,10 +18,10 @@ mod time; mod year_month; mod zoneddatetime; -#[cfg(feature = "std")] +#[cfg(feature = "now")] mod now; -#[cfg(feature = "std")] +#[cfg(feature = "now")] #[doc(inline)] pub use now::Now; diff --git a/src/lib.rs b/src/lib.rs index 185d53c7b..ac795f3cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,7 +54,7 @@ pub mod primitive; pub(crate) mod components; pub(crate) mod iso; -#[cfg(feature = "std")] +#[cfg(feature = "now")] mod sys; #[cfg(feature = "tzdb")] diff --git a/src/sys.rs b/src/sys.rs index 5a074a587..e4e9fa101 100644 --- a/src/sys.rs +++ b/src/sys.rs @@ -7,6 +7,7 @@ use web_time::{SystemTime, UNIX_EPOCH}; // TODO: Need to implement SystemTime handling for non_std. /// Returns the system time in nanoseconds. +#[cfg(feature = "now")] pub(crate) fn get_system_nanoseconds() -> TemporalResult { SystemTime::now() .duration_since(UNIX_EPOCH)