Struct gregor::DateTime
[−]
[src]
pub struct DateTime<Tz: TimeZone> { pub naive: NaiveDateTime, pub time_zone: Tz, }
Fields
naive: NaiveDateTime
time_zone: Tz
Methods
impl<Tz: TimeZone> DateTime<Tz>
[src]
fn new(
time_zone: Tz,
year: i32,
month: Month,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Self
time_zone: Tz,
year: i32,
month: Month,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Self
fn year(&self) -> i32
fn month(&self) -> Month
fn day(&self) -> u8
fn hour(&self) -> u8
fn minute(&self) -> u8
fn second(&self) -> u8
fn day_of_the_week(&self) -> DayOfTheWeek
fn from_timestamp(t: UnixTimestamp, time_zone: Tz) -> Self
fn to_timestamp(&self) -> Result<UnixTimestamp, LocalTimeConversionError>
fn convert_time_zone<NewTz: TimeZone>(
&self,
new_time_zone: NewTz
) -> Result<DateTime<NewTz>, LocalTimeConversionError>
&self,
new_time_zone: NewTz
) -> Result<DateTime<NewTz>, LocalTimeConversionError>
impl<Tz: UnambiguousTimeZone> DateTime<Tz>
[src]
fn to_unambiguous_timestamp(&self) -> UnixTimestamp
fn convert_unambiguous_time_zone<NewTz: TimeZone>(
&self,
new_time_zone: NewTz
) -> DateTime<NewTz>
&self,
new_time_zone: NewTz
) -> DateTime<NewTz>
Trait Implementations
impl<Tz: Eq + TimeZone> Eq for DateTime<Tz>
[src]
impl<Tz: PartialEq + TimeZone> PartialEq for DateTime<Tz>
[src]
fn eq(&self, __arg_0: &DateTime<Tz>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &DateTime<Tz>) -> bool
This method tests for !=
.
impl<Tz: Copy + TimeZone> Copy for DateTime<Tz>
[src]
impl<Tz: Clone + TimeZone> Clone for DateTime<Tz>
[src]
fn clone(&self) -> DateTime<Tz>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<Tz: Debug + TimeZone> Debug for DateTime<Tz>
[src]
impl<Tz: Default + TimeZone> From<UnixTimestamp> for DateTime<Tz>
[src]
fn from(u: UnixTimestamp) -> Self
Performs the conversion.