pub struct Time;
Expand description
Cross-platform time utilities that work on both native and WASM
Implementations§
Source§impl Time
impl Time
Sourcepub fn now_millis() -> u64
pub fn now_millis() -> u64
Get current timestamp as milliseconds since epoch
Sourcepub fn from_millis(millis: i64) -> DateTime<Utc>
pub fn from_millis(millis: i64) -> DateTime<Utc>
Create a DateTime from milliseconds since epoch
Sourcepub fn duration_millis(millis: i64) -> Duration
pub fn duration_millis(millis: i64) -> Duration
Create a duration from milliseconds
Sourcepub fn duration_secs(secs: i64) -> Duration
pub fn duration_secs(secs: i64) -> Duration
Create a duration from seconds
Sourcepub fn duration_hours(hours: i64) -> Duration
pub fn duration_hours(hours: i64) -> Duration
Create a duration from hours
Sourcepub fn duration_days(days: i64) -> Duration
pub fn duration_days(days: i64) -> Duration
Create a duration from days
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnwindSafe for Time
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
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.