mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 02:54:25 +00:00
11 lines
404 B
Rust
11 lines
404 B
Rust
//! Time and calendar conversions for release timestamps.
|
|
//!
|
|
//! Calendar conversion goes through chrono, in accordance with the AGENTS.md shared standard.
|
|
|
|
use chrono::DateTime;
|
|
|
|
/// Seconds since the Unix epoch for an RFC 3339 UTC timestamp such as `2026-10-08T14:52:50Z`.
|
|
pub fn parse_rfc3339(text: &str) -> Option<i64> {
|
|
DateTime::parse_from_rfc3339(text.trim()).ok().map(|dt| dt.timestamp())
|
|
}
|