Skip to main content

unix

Function unix 

Source
pub fn unix() -> u64
Available on crate feature std only.
Expand description

Returns the current Unix time in whole seconds.

Shortcut for wall().unix_seconds(). Equivalent in spirit to C’s time(NULL) or PHP’s time().

Returns zero if the system clock is set to a moment before the Unix epoch.

§Examples

use clock_lib as clock;

let now = clock::unix();
assert!(now > 0);