Skip to main content

format_timestamp

Function format_timestamp 

Source
pub fn format_timestamp(timestamp_ms: i64, format: &str) -> String
Expand description

Format a Unix timestamp (in milliseconds) using the given format string.

Uses chrono format specifiers:

  • %Y = year (4 digits)
  • %m = month (01-12)
  • %d = day (01-31)
  • %H = hour (00-23)
  • %M = minute (00-59)
  • %S = second (00-59)
  • %F = ISO date (YYYY-MM-DD)
  • %T = ISO time (HH:MM:SS)