Skip to main content

human_date_utc

Function human_date_utc 

Source
pub fn human_date_utc(secs: u64) -> String
Expand description

Render a Unix timestamp (seconds since the epoch, UTC) as a stable, human-readable string: YYYY-MM-DD HH:MM:SS +0000.

The format is fixed UTC (+0000) and intentionally locale- and timezone-independent so log output is reproducible across machines. Machine-readable callers (e.g. mkit log --format=json) keep the raw integer instead — only the default human log uses this.

Implemented with Howard Hinnant’s civil-from-days algorithm to avoid pulling in a date/time crate. Valid for the entire u64 range.