Skip to main content

rfc3339

Function rfc3339 

Source
pub fn rfc3339(t: SystemTime) -> String
Expand description

A SystemTime as RFC 3339 in UTC, to the second (2026-09-05T12:34:56Z).

use std::time::{Duration, UNIX_EPOCH};
use majordomus_cli::peers::rfc3339;
assert_eq!(rfc3339(UNIX_EPOCH), "1970-01-01T00:00:00Z");
assert_eq!(rfc3339(UNIX_EPOCH + Duration::from_secs(1_788_000_000)), "2026-08-29T10:40:00Z");