[][src]Struct uhr::DateTime

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

Fields

naive: NaiveDateTimetime_zone: Tz

Methods

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

pub fn new(
    time_zone: Tz,
    year: i32,
    month: Month,
    day: u8,
    hour: u8,
    minute: u8,
    second: u8
) -> DateTime<Tz>
[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) -> DateTime<Tz>[src]

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

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

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

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

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

Trait Implementations

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

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

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

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

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

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

impl<Tz> Clone for DateTime<Tz> where
    Tz: TimeZone + Clone
[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]

impl<T> Same for T

type Output = T

Should always be Self