pub fn epoch_seconds(ts: &str) -> Option<i64>Expand description
Seconds since the Unix epoch for an RFC 3339 instant in UTC (2026-09-05T12:34:56Z), or
None when the string is not one. The inverse of crate::peers::rfc3339, and written
beside it for the same reason: no date crate, and the layer’s timestamps are one shape.
use majordomus_cli::capability::builtin::continuity::epoch_seconds;
assert_eq!(epoch_seconds("1970-01-01T00:00:00Z"), Some(0));
assert_eq!(epoch_seconds("2026-08-29T10:40:00Z"), Some(1_788_000_000));
assert_eq!(epoch_seconds("not a timestamp"), None);