expression

UNIX_EPOCH: timestamp anchor

The Unix epoch is the conventional start of Unix timestamps, 1970-01-01 00:00:00 UTC. Compute an offset relative to it; represent pre-epoch values explicitly. Unix time here does not count leap seconds. Expected stdout (not executed): 86400 Common mistake: Equating a Unix timestamp to a formatted local date without a time zone.

Formal Syntax & Structure

rust syntaxrust
std::time::UNIX_EPOCH: SystemTime

Working Example

Example Snippetrust
fn main() {    use std::time::{Duration, UNIX_EPOCH};    let t = UNIX_EPOCH + Duration::from_secs(86_400);    println!("{}", t.duration_since(UNIX_EPOCH).unwrap().as_secs());}
Rust Reference