#[repr(transparent)]pub struct DateTime { /* private fields */ }
Implementations
sourceimpl DateTime
impl DateTime
pub fn new(
tz: &TimeZone,
year: i32,
month: i32,
day: i32,
hour: i32,
minute: i32,
seconds: f64
) -> Result<DateTime, BoolError>
pub fn from_iso8601(
text: &str,
default_tz: Option<&TimeZone>
) -> Result<DateTime, BoolError>
pub fn from_unix_local(t: i64) -> Result<DateTime, BoolError>
pub fn from_unix_utc(t: i64) -> Result<DateTime, BoolError>
pub fn from_local(
year: i32,
month: i32,
day: i32,
hour: i32,
minute: i32,
seconds: f64
) -> Result<DateTime, BoolError>
pub fn now(tz: &TimeZone) -> Result<DateTime, BoolError>
pub fn now_local() -> Result<DateTime, BoolError>
pub fn now_utc() -> Result<DateTime, BoolError>
pub fn from_utc(
year: i32,
month: i32,
day: i32,
hour: i32,
minute: i32,
seconds: f64
) -> Result<DateTime, BoolError>
pub fn add(&self, timespan: TimeSpan) -> Result<DateTime, BoolError>
pub fn add_days(&self, days: i32) -> Result<DateTime, BoolError>
pub fn add_full(
&self,
years: i32,
months: i32,
days: i32,
hours: i32,
minutes: i32,
seconds: f64
) -> Result<DateTime, BoolError>
pub fn add_hours(&self, hours: i32) -> Result<DateTime, BoolError>
pub fn add_minutes(&self, minutes: i32) -> Result<DateTime, BoolError>
pub fn add_months(&self, months: i32) -> Result<DateTime, BoolError>
pub fn add_seconds(&self, seconds: f64) -> Result<DateTime, BoolError>
pub fn add_weeks(&self, weeks: i32) -> Result<DateTime, BoolError>
pub fn add_years(&self, years: i32) -> Result<DateTime, BoolError>
pub fn difference(&self, begin: &DateTime) -> TimeSpan
pub fn format(&self, format: &str) -> Result<GString, BoolError>
pub fn format_iso8601(&self) -> Result<GString, BoolError>
Available on crate feature
v2_62
only.pub fn day_of_month(&self) -> i32
pub fn day_of_week(&self) -> i32
pub fn day_of_year(&self) -> i32
pub fn hour(&self) -> i32
pub fn microsecond(&self) -> i32
pub fn minute(&self) -> i32
pub fn month(&self) -> i32
pub fn second(&self) -> i32
pub fn seconds(&self) -> f64
pub fn timezone(&self) -> TimeZone
Available on crate feature
v2_58
only.pub fn timezone_abbreviation(&self) -> GString
pub fn utc_offset(&self) -> TimeSpan
pub fn week_numbering_year(&self) -> i32
pub fn week_of_year(&self) -> i32
pub fn year(&self) -> i32
pub fn ymd(&self) -> (i32, i32, i32)
pub fn is_daylight_savings(&self) -> bool
pub fn to_local(&self) -> Result<DateTime, BoolError>
pub fn to_timezone(&self, tz: &TimeZone) -> Result<DateTime, BoolError>
pub fn to_unix(&self) -> i64
pub fn to_utc(&self) -> Result<DateTime, BoolError>
Trait Implementations
sourceimpl Ord for DateTime
impl Ord for DateTime
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<DateTime> for DateTime
impl PartialEq<DateTime> for DateTime
sourceimpl PartialOrd<DateTime> for DateTime
impl PartialOrd<DateTime> for DateTime
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl StaticType for DateTime
impl StaticType for DateTime
sourcefn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of Self
.
impl Eq for DateTime
impl Send for DateTime
impl Sync for DateTime
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> StaticTypeExt for T where
T: StaticType,
impl<T> StaticTypeExt for T where
T: StaticType,
sourcefn ensure_type()
fn ensure_type()
Ensures that the type has been registered with the type system.
sourceimpl<T> ToClosureReturnValue for T where
T: ToValue,
impl<T> ToClosureReturnValue for T where
T: ToValue,
fn to_closure_return_value(&self) -> Option<Value>
sourceimpl<T> ToSendValue for T where
T: Send + ToValue + ?Sized,
impl<T> ToSendValue for T where
T: Send + ToValue + ?Sized,
sourcefn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
Returns a SendValue
clone of self
.