Expand description
time module provides re-export of WASM32-compatible Instant and provides
platform neutral implementations for unixtime_as_millis_u128() and
unixtime_as_millis_f64().
Structs§
- Duration
- re-export of [
instant] crate supporting native and WASM implementations ADurationtype to represent a span of time, typically used for system timeouts. - Instant
- re-export of [
instant] crate supporting native and WASM implementations A measurement of a monotonically nondecreasing clock. Opaque and useful only withDuration. - System
Time - re-export of [
instant] crate supporting native and WASM implementations A measurement of the system clock, useful for talking to external entities like the file system or other processes. - System
Time Error - re-export of [
instant] crate supporting native and WASM implementations An error returned from theduration_sinceandelapsedmethods onSystemTime, used to learn how far in the opposite direction a system time lies. - TryFrom
Float Secs Error - re-export of [
instant] crate supporting native and WASM implementations An error which can be returned when converting a floating-point value of seconds into aDuration.
Enums§
- Time
Format - Selects how unix timestamps are rendered to locale strings.
Constants§
- DAYS
- Number of milliseconds in one day.
- HOURS
- Number of milliseconds in one hour.
- MINUTES
- Number of milliseconds in one minute.
- SECONDS
- Number of milliseconds in one second.
- UNIX_
EPOCH - re-export of [
instant] crate supporting native and WASM implementations An anchor in time which can be used to create newSystemTimeinstances or learn about where in time aSystemTimelies.
Functions§
- init_
desired_ time_ format - Sets the
TimeFormatused byunixtime_to_locale_stringfor subsequent native timestamp formatting. - unixtime_
as_ millis_ f64 - Returns the current unix time in milliseconds as an
f64. - unixtime_
as_ millis_ u64 - Returns the current unix time in milliseconds as a
u64. - unixtime_
as_ millis_ u128 - Returns the current unix time in milliseconds as a
u128. - unixtime_
to_ locale_ string - Formats a unix time in milliseconds as a local-time string using the
format configured via
init_desired_time_format.