pub trait ToValue { // Required method fn to_value(&self) -> Value; }
Converts a timestamp to a JSON string value in RFC3339 format
let timestamp = Utc.with_ymd_and_hms(2024, 10, 13, 19, 0, 0).unwrap(); let value = timestamp.to_value(); assert_eq!(value, json!("2024-10-13T19:00:00+00:00"));