Skip to main content

format_date

Function format_date 

Source
pub fn format_date(ts: i64, fmt: &DateFormat) -> String
Expand description

Format a Unix timestamp (seconds). When fmt.relative is set, the result is a “2 days ago” / “in 3 weeks” string relative to SystemTime::now(); use format_date_at to inject a frozen clock for tests.