[][src]Struct gregor::DateTime

pub struct DateTime<Tz: TimeZone> {
    pub naive: NaiveDateTime,
    pub time_zone: Tz,
}

Fields

naive: NaiveDateTimetime_zone: Tz

Methods

impl<Tz: TimeZone> DateTime<Tz>[src]

pub fn new(
    time_zone: Tz,
    year: i32,
    month: Month,
    day: u8,
    hour: u8,
    minute: u8,
    second: u8
) -> Self
[src]

pub fn year(&self) -> i32[src]

pub fn month(&self) -> Month[src]

pub fn day(&self) -> u8[src]

pub fn hour(&self) -> u8[src]

pub fn minute(&self) -> u8[src]

pub fn second(&self) -> u8[src]

pub fn day_of_the_week(&self) -> DayOfTheWeek[src]

pub fn from_timestamp(t: UnixTimestamp, time_zone: Tz) -> Self[src]

pub fn to_timestamp(&self) -> Result<UnixTimestamp, LocalTimeConversionError>[src]

pub fn convert_time_zone<NewTz: TimeZone>(
    &self,
    new_time_zone: NewTz
) -> Result<DateTime<NewTz>, LocalTimeConversionError>
[src]

impl<Tz: UnambiguousTimeZone> DateTime<Tz>[src]

pub fn to_unambiguous_timestamp(&self) -> UnixTimestamp[src]

pub fn convert_unambiguous_time_zone<NewTz: TimeZone>(
    &self,
    new_time_zone: NewTz
) -> DateTime<NewTz>
[src]

Trait Implementations

impl<Tz: Copy + TimeZone> Copy for DateTime<Tz>[src]

impl<Tz: Debug + TimeZone> Debug for DateTime<Tz>[src]

impl<Tz: PartialEq + TimeZone> PartialEq<DateTime<Tz>> for DateTime<Tz>[src]

impl<Tz: Eq + TimeZone> Eq for DateTime<Tz>[src]

impl<Tz: Ord + TimeZone> Ord for DateTime<Tz>[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more

impl<Tz: PartialOrd + TimeZone> PartialOrd<DateTime<Tz>> for DateTime<Tz>[src]

impl<Tz: Default + TimeZone> From<UnixTimestamp> for DateTime<Tz>[src]

impl<Tz: UnambiguousTimeZone> From<DateTime<Tz>> for UnixTimestamp[src]

impl<Tz: Clone + TimeZone> Clone for DateTime<Tz>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<Tz> Send for DateTime<Tz> where
    Tz: Send

impl<Tz> Sync for DateTime<Tz> where
    Tz: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]