]> git.proxmox.com Git - rustc.git/blob - vendor/time/src/sys/local_offset_at/mod.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / vendor / time / src / sys / local_offset_at / mod.rs
1 //! A method to obtain the local offset from UTC.
2
3 #![allow(clippy::missing_const_for_fn)]
4
5 #[cfg_attr(target_family = "windows", path = "windows.rs")]
6 #[cfg_attr(target_family = "unix", path = "unix.rs")]
7 #[cfg_attr(
8 all(
9 target_arch = "wasm32",
10 not(any(target_os = "emscripten", target_os = "wasi")),
11 feature = "wasm-bindgen"
12 ),
13 path = "wasm_js.rs"
14 )]
15 mod imp;
16
17 use crate::{OffsetDateTime, UtcOffset};
18
19 /// Attempt to obtain the system's UTC offset. If the offset cannot be determined, `None` is
20 /// returned.
21 pub(crate) fn local_offset_at(datetime: OffsetDateTime) -> Option<UtcOffset> {
22 imp::local_offset_at(datetime)
23 }