pub enum TimeFormat {
None,
EpochSeconds,
EpochMilliseconds,
EpochMicroseconds,
EpochNanoseconds,
RFC2822,
RFC3339,
RFC3339Options(SecondsFormat, bool),
PrettyTime,
PrettyDateTime,
CustomFormat(&'static str),
}Expand description
Change the time formatting
Variants§
None
Turn off the time field
EpochSeconds
Unix epoch seconds since 1970-01-01 00:00:00 e.g. 1672574869
EpochMilliseconds
Unix epoch millseconds since 1970-01-01 00:00:00 e.g. 1672574869384
EpochMicroseconds
Unix epoch microseconds since 1970-01-01 00:00:00 e.g. 1672574869384925
EpochNanoseconds
Unix epoch nanoseconds since 1970-01-01 00:00:00 e.g. 1672575028752943000
RFC2822
Well known format e.g. Sun, 01 Jan 2023 12:10:28 +0000
RFC3339
Well known format like ISO 8601 e.g. 2022-12-31T00:15:08.241974+00:00
RFC3339Options(SecondsFormat, bool)
Seconds format and bool to replace +00:00 timezone with Z e.g. (SecondsFormat::Secs, true) = 2022-12-31T00:15:08Z
PrettyTime
Pretty Print the time in format HH:mm:SS
PrettyDateTime
Pretty Print the date in format YYYY:MM::DD HH:mm:SS
CustomFormat(&'static str)
Use a format string to change the datetime formate e.g. YYYY:MM::DD HH:mm:SS
Trait Implementations§
Source§impl Clone for TimeFormat
impl Clone for TimeFormat
Source§fn clone(&self) -> TimeFormat
fn clone(&self) -> TimeFormat
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 PartialEq for TimeFormat
impl PartialEq for TimeFormat
impl Eq for TimeFormat
impl StructuralPartialEq for TimeFormat
Auto Trait Implementations§
impl Freeze for TimeFormat
impl RefUnwindSafe for TimeFormat
impl Send for TimeFormat
impl Sync for TimeFormat
impl Unpin for TimeFormat
impl UnwindSafe for TimeFormat
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