pub trait PrimitiveDateTimeExt: PrimitiveDateTimeExt {
    // Required methods
    fn assume_timezone<T: TimeZone>(
        &self,
        tz: &T
    ) -> OffsetResult<OffsetDateTime>;
    fn assume_timezone_utc<T: TimeZone>(&self, tz: &T) -> OffsetDateTime;
}
Expand description

This trait is sealed and is only implemented in this library.

Required Methods§

source

fn assume_timezone<T: TimeZone>(&self, tz: &T) -> OffsetResult<OffsetDateTime>

Creates a new OffsetDateTime from a PrimitiveDateTime by assigning the main offset of the target timezone.

This assumes the PrimitiveDateTime is already in the target timezone.

Arguments
  • tz: the target timezone.

returns: OffsetResult<OffsetDateTime>

source

fn assume_timezone_utc<T: TimeZone>(&self, tz: &T) -> OffsetDateTime

Creates a new OffsetDateTime with the proper offset in the given timezone.

This assumes the PrimitiveDateTime is in UTC offset.

Arguments
  • tz: the target timezone.

returns: OffsetDateTime

Implementations on Foreign Types§

source§

impl PrimitiveDateTimeExt for PrimitiveDateTime

Implementors§