time/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_family = "wasm",
10 not(any(target_os = "emscripten", target_os = "wasi")),
11 feature = "wasm-bindgen"
12 ),
13 path = "wasm_js.rs"
14)]
15mod imp;
16
17use crate::{OffsetDateTime, UtcOffset};
18
19/// Attempt to obtain the system's UTC offset. If the offset cannot be determined, `None` is
20/// returned.
21pub(crate) fn local_offset_at(datetime: OffsetDateTime) -> Option<UtcOffset> {
22 imp::local_offset_at(datetime)
23}