pub struct UTCDateTime { /* private fields */ }Expand description
Represents a Gregorian Date and Time in UTC
Implementations§
Source§impl UTCDateTime
impl UTCDateTime
Sourcepub fn new(date: Date, time: Time) -> UTCDateTime
pub fn new(date: Date, time: Time) -> UTCDateTime
New UTC Date and Time
Sourcepub fn try_from_values(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
seconds: u8,
) -> Result<UTCDateTime, GreaterThanEqualToValueError<u8>>
pub fn try_from_values( year: i32, month: u8, day: u8, hour: u8, minute: u8, seconds: u8, ) -> Result<UTCDateTime, GreaterThanEqualToValueError<u8>>
New UTC Date and Time from the specified values
Sourcepub fn try_from_values_f64(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
seconds: f64,
) -> Result<UTCDateTime, GreaterThanEqualToValueError<f64>>
pub fn try_from_values_f64( year: i32, month: u8, day: u8, hour: u8, minute: u8, seconds: f64, ) -> Result<UTCDateTime, GreaterThanEqualToValueError<f64>>
New UTC date and Time from the specified values (fractional seconds)
pub fn format<T: Format<UTCDateTime>>(&self, format: &T) -> String
Sourcepub fn format_iso8601_extended(&self) -> String
pub fn format_iso8601_extended(&self) -> String
Formats this date as a extended ISO8601 Date & Time, 2023-12-31T05:10:25Z
Sourcepub fn format_iso8601_basic(&self) -> String
pub fn format_iso8601_basic(&self) -> String
Formats this date as a basic ISO8601 Date & Time, 20231231T051025Z, suitable for filenames
Sourcepub fn try_from_iso8601(val: &str) -> Result<Self, FormatError>
pub fn try_from_iso8601(val: &str) -> Result<Self, FormatError>
Attempts to parse the provided string as either a crate::format::iso8601::BasicDateTimeOfDay or a crate::format::iso8601::ExtendedDateTimeFormat
Trait Implementations§
Source§impl Add<&Duration> for UTCDateTime
impl Add<&Duration> for UTCDateTime
Source§impl Add<Duration> for UTCDateTime
impl Add<Duration> for UTCDateTime
Source§impl AddAssign<&Duration> for UTCDateTime
impl AddAssign<&Duration> for UTCDateTime
Source§fn add_assign(&mut self, rhs: &Duration)
fn add_assign(&mut self, rhs: &Duration)
Performs the
+= operation. Read moreSource§impl AddAssign<Duration> for UTCDateTime
impl AddAssign<Duration> for UTCDateTime
Source§fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the
+= operation. Read moreSource§impl Clone for UTCDateTime
impl Clone for UTCDateTime
Source§fn clone(&self) -> UTCDateTime
fn clone(&self) -> UTCDateTime
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UTCDateTime
impl Debug for UTCDateTime
Source§impl Default for UTCDateTime
impl Default for UTCDateTime
Source§fn default() -> UTCDateTime
fn default() -> UTCDateTime
Returns the “default value” for a type. Read more
Source§impl Display for UTCDateTime
impl Display for UTCDateTime
Source§impl Format<UTCDateTime> for BasicCalendarDate
impl Format<UTCDateTime> for BasicCalendarDate
Source§fn format(&self, date: &UTCDateTime) -> String
fn format(&self, date: &UTCDateTime) -> String
Implementation-specific format of a date or time
Source§impl Format<UTCDateTime> for BasicDateTimeOfDay
impl Format<UTCDateTime> for BasicDateTimeOfDay
Source§fn format(&self, date: &UTCDateTime) -> String
fn format(&self, date: &UTCDateTime) -> String
Implementation-specific format of a date or time
Source§impl Format<UTCDateTime> for BasicTimeOfDay
impl Format<UTCDateTime> for BasicTimeOfDay
Source§fn format(&self, date: &UTCDateTime) -> String
fn format(&self, date: &UTCDateTime) -> String
Implementation-specific format of a date or time
Source§impl Format<UTCDateTime> for ExtendedDateFormat
impl Format<UTCDateTime> for ExtendedDateFormat
Source§fn format(&self, date: &UTCDateTime) -> String
fn format(&self, date: &UTCDateTime) -> String
Implementation-specific format of a date or time
Source§impl Format<UTCDateTime> for ExtendedDateTimeFormat
impl Format<UTCDateTime> for ExtendedDateTimeFormat
Source§fn format(&self, date: &UTCDateTime) -> String
fn format(&self, date: &UTCDateTime) -> String
Implementation-specific format of a date or time
Source§impl Format<UTCDateTime> for ExtendedTimeFormat
impl Format<UTCDateTime> for ExtendedTimeFormat
Source§fn format(&self, date: &UTCDateTime) -> String
fn format(&self, date: &UTCDateTime) -> String
Implementation-specific format of a date or time
Source§impl Format<UTCDateTime> for ISO8601DateTime
impl Format<UTCDateTime> for ISO8601DateTime
Source§fn format(&self, date: &UTCDateTime) -> String
fn format(&self, date: &UTCDateTime) -> String
Implementation-specific format of a date or time
Source§impl FormatParser<UTCDateTime> for BasicDateTimeOfDay
impl FormatParser<UTCDateTime> for BasicDateTimeOfDay
Source§fn try_from(&self, data: &str) -> Result<UTCDateTime, FormatError>
fn try_from(&self, data: &str) -> Result<UTCDateTime, FormatError>
Tries to parse the specified string into the resultant item.
Source§impl FormatParser<UTCDateTime> for ExtendedDateTimeFormat
impl FormatParser<UTCDateTime> for ExtendedDateTimeFormat
Source§fn try_from(&self, data: &str) -> Result<UTCDateTime, FormatError>
fn try_from(&self, data: &str) -> Result<UTCDateTime, FormatError>
Tries to parse the specified string into the resultant item.
Source§impl FormatParser<UTCDateTime> for ISO8601DateTime
impl FormatParser<UTCDateTime> for ISO8601DateTime
Source§fn try_from(&self, data: &str) -> Result<UTCDateTime, FormatError>
fn try_from(&self, data: &str) -> Result<UTCDateTime, FormatError>
Tries to parse the specified string into the resultant item.
Source§impl From<&Timestamp<UnixEpoch>> for UTCDateTime
impl From<&Timestamp<UnixEpoch>> for UTCDateTime
Source§fn from(value: &UnixTimestamp) -> Self
fn from(value: &UnixTimestamp) -> Self
Converts to this type from the input type.
Source§impl From<&UTCDateTime> for JulianDate
impl From<&UTCDateTime> for JulianDate
Source§fn from(value: &UTCDateTime) -> Self
fn from(value: &UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<&UTCDateTime> for Time128
impl From<&UTCDateTime> for Time128
Source§fn from(value: &UTCDateTime) -> Self
fn from(value: &UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<&UTCDateTime> for Time32
impl From<&UTCDateTime> for Time32
Source§fn from(value: &UTCDateTime) -> Self
fn from(value: &UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<&UTCDateTime> for Time64
impl From<&UTCDateTime> for Time64
Source§fn from(value: &UTCDateTime) -> Self
fn from(value: &UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<&UTCDateTime> for UnixTimestamp
impl From<&UTCDateTime> for UnixTimestamp
Source§fn from(value: &UTCDateTime) -> Self
fn from(value: &UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<&mut UTCDateTime> for Time128
impl From<&mut UTCDateTime> for Time128
Source§fn from(value: &mut UTCDateTime) -> Self
fn from(value: &mut UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<&mut UTCDateTime> for Time32
impl From<&mut UTCDateTime> for Time32
Source§fn from(value: &mut UTCDateTime) -> Self
fn from(value: &mut UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<&mut UTCDateTime> for Time64
impl From<&mut UTCDateTime> for Time64
Source§fn from(value: &mut UTCDateTime) -> Self
fn from(value: &mut UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<Timestamp<UnixEpoch>> for UTCDateTime
impl From<Timestamp<UnixEpoch>> for UTCDateTime
Source§fn from(value: UnixTimestamp) -> Self
fn from(value: UnixTimestamp) -> Self
Converts to this type from the input type.
Source§impl From<UTCDateTime> for JulianDate
impl From<UTCDateTime> for JulianDate
Source§fn from(value: UTCDateTime) -> Self
fn from(value: UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<UTCDateTime> for Time128
impl From<UTCDateTime> for Time128
Source§fn from(value: UTCDateTime) -> Self
fn from(value: UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<UTCDateTime> for Time32
impl From<UTCDateTime> for Time32
Source§fn from(value: UTCDateTime) -> Self
fn from(value: UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<UTCDateTime> for Time64
impl From<UTCDateTime> for Time64
Source§fn from(value: UTCDateTime) -> Self
fn from(value: UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<UTCDateTime> for UnixTimestamp
impl From<UTCDateTime> for UnixTimestamp
Source§fn from(value: UTCDateTime) -> Self
fn from(value: UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl Ord for UTCDateTime
impl Ord for UTCDateTime
Source§fn cmp(&self, other: &UTCDateTime) -> Ordering
fn cmp(&self, other: &UTCDateTime) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for UTCDateTime
impl PartialEq for UTCDateTime
Source§impl PartialOrd for UTCDateTime
impl PartialOrd for UTCDateTime
Source§impl Sub<&UTCDateTime> for UTCDateTime
impl Sub<&UTCDateTime> for UTCDateTime
Source§impl Sub for UTCDateTime
impl Sub for UTCDateTime
impl Copy for UTCDateTime
impl Eq for UTCDateTime
impl StructuralPartialEq for UTCDateTime
Auto Trait Implementations§
impl Freeze for UTCDateTime
impl RefUnwindSafe for UTCDateTime
impl Send for UTCDateTime
impl Sync for UTCDateTime
impl Unpin for UTCDateTime
impl UnwindSafe for UTCDateTime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more