Skip to main content

relative_time

Function relative_time 

Source
pub fn relative_time(dt: DateTime<Utc>) -> String
Expand description

Return a human-friendly relative-time string for the given UTC timestamp.

§Examples

  • "just now"
  • "1 minute ago" / "5 minutes ago"
  • "1 hour ago" / "3 hours ago"
  • "1 day ago" / "2 days ago"
  • "1 week ago" / "3 weeks ago"
  • "1 month ago" / "6 months ago"
  • "1 year ago" / "2 years ago"