Skip to content

time

Time helpers. Reading the clock is explicit and fallible: a clock set before 1970 is an error, not 0.

Cargo feature time (enabled by default). To compile only this module:

cargo add helpers4 --no-default-features --features time

or in Cargo.toml:

[dependencies]
helpers4 = { version = "0.0.5", default-features = false, features = ["time"] }

Import path: helpers4::time.

ItemWhat it does
unix_nowThe current time as whole seconds since the Unix epoch.
unix_now_millisThe current time as milliseconds since the Unix epoch.

Documented on the page of the helper that returns them.

TypeReturned by
ClockErrorunix_now, unix_now_millis