pub struct Zone { /* private fields */ }Expand description
A time zone and its IANA name, when it has one.
Implementations§
Source§impl Zone
impl Zone
Sourcepub fn from_tz(tz: Option<&str>) -> Zone
pub fn from_tz(tz: Option<&str>) -> Zone
The zone for the value of TZ. Without one it is the system’s zone,
from /etc/localtime. A value names a zone file or spells a POSIX
rule. A value that does neither means UTC, as in Node, and so does an
empty value or a system without a zone.
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
The zone’s IANA name, such as Europe/London, when it has one.
Sourcepub fn offset(&self, unix_seconds: i64) -> i32
pub fn offset(&self, unix_seconds: i64) -> i32
The zone’s offset from UTC at unix_seconds, in seconds east.
Sourcepub fn local_offset(&self, local: i64) -> i32
pub fn local_offset(&self, local: i64) -> i32
The offset that turns wall-clock time local, in seconds as if UTC,
into UTC, as Node chooses it: the earlier instant of a time that
occurs twice, and the offset before the change for a skipped time.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Zone
impl RefUnwindSafe for Zone
impl Send for Zone
impl Sync for Zone
impl Unpin for Zone
impl UnsafeUnpin for Zone
impl UnwindSafe for Zone
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more