Trait time_tz::TimeZone

source ·
pub trait TimeZone {
    type Offset: Offset;

    // Required methods
    fn get_offset_utc(&self, date_time: &OffsetDateTime) -> Self::Offset;
    fn get_offset_local(
        &self,
        date_time: &OffsetDateTime
    ) -> OffsetResult<Self::Offset>;
    fn get_offset_primary(&self) -> Self::Offset;
    fn name(&self) -> &str;
}
Expand description

This trait represents a timezone provider.

Required Associated Types§

source

type Offset: Offset

The type of offset.

Required Methods§

source

fn get_offset_utc(&self, date_time: &OffsetDateTime) -> Self::Offset

Search for the given date time offset (assuming it is UTC) in this timezone.

source

fn get_offset_local( &self, date_time: &OffsetDateTime ) -> OffsetResult<Self::Offset>

Search for the given date time offset (assuming it is already local) in this timezone.

source

fn get_offset_primary(&self) -> Self::Offset

Gets the main/default offset in this timezone.

source

fn name(&self) -> &str

Returns the name of this timezone.

Implementors§

source§

impl TimeZone for Tz

§

type Offset = TzOffset