Skip to main content

format_timestamp

Function format_timestamp 

Source
pub fn format_timestamp(secs: f64, span_secs: f64) -> String
Expand description

Formats a timestamp (seconds since the Unix epoch) as a calendar label, choosing granularity from the visible span_secs:

spanformat
> ~2 yearsYYYY
> ~2 monthsYYYY-MM
> ~2 daysMM-DD
> ~2 minutesHH:MM
otherwiseHH:MM:SS