Skip to main content

format_datetime

Function format_datetime 

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

Format a datetime for display

ยงExamples

use things3_common::format_datetime;
use chrono::{TimeZone, Utc};

let dt = Utc.with_ymd_and_hms(2024, 1, 15, 14, 30, 0).unwrap();
assert_eq!(format_datetime(&dt), "2024-01-15 14:30:00 UTC");