[−][src]Struct gregor::DateTime
Fields
naive: NaiveDateTime
time_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]
time_zone: Tz,
year: i32,
month: Month,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Self
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]
&self,
new_time_zone: NewTz
) -> Result<DateTime<NewTz>, LocalTimeConversionError>
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]
&self,
new_time_zone: NewTz
) -> DateTime<NewTz>
Trait Implementations
impl<Tz: Clone + TimeZone> Clone for DateTime<Tz>
[src]
fn clone(&self) -> DateTime<Tz>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
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 cmp(&self, other: &DateTime<Tz>) -> Ordering
[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]
fn partial_cmp(&self, other: &DateTime<Tz>) -> Option<Ordering>
[src]
fn lt(&self, other: &DateTime<Tz>) -> bool
[src]
fn le(&self, other: &DateTime<Tz>) -> bool
[src]
fn gt(&self, other: &DateTime<Tz>) -> bool
[src]
fn ge(&self, other: &DateTime<Tz>) -> bool
[src]
impl<Tz: Default + TimeZone> From<UnixTimestamp> for DateTime<Tz>
[src]
fn from(u: UnixTimestamp) -> Self
[src]
impl<Tz: UnambiguousTimeZone> From<DateTime<Tz>> for UnixTimestamp
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,