pub trait PrimitiveDateTimeExt: PrimitiveDateTimeExt {
    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

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

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

Implementors