···1313use crate::{CowStr, IntoStatic};
1414#[cfg(all(not(target_arch = "wasm32"), feature = "std"))]
1515use regex::Regex;
1616+#[cfg(all(not(target_arch = "wasm32"), not(feature = "std")))]
1717+use regex_automata::meta::Regex;
1618#[cfg(target_arch = "wasm32")]
1719use regex_lite::Regex;
1818-#[cfg(all(not(target_arch = "wasm32"), not(feature = "std")))]
1919-use regex_automata::meta::Regex;
20202121/// Regex for ISO 8601 datetime validation per AT Protocol spec
2222pub static ISO8601_REGEX: Lazy<Regex> = Lazy::new(|| {
···105105 #[must_use]
106106 pub fn as_str(&self) -> &str {
107107 self.serialized.as_ref()
108108+ }
109109+110110+ /// Extracts the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka "UNIX timestamp").
111111+ ///
112112+ /// For full access to the underlying DateTime, use the [`AsRef<chrono::DateTime<chrono::FixedOffset>>`] implementation.
113113+ #[inline]
114114+ #[must_use]
115115+ pub fn timestamp(&self) -> i64 {
116116+ self.dt.timestamp()
117117+ }
118118+119119+ /// Extracts the number of non-leap-milliseconds since January 1, 1970 UTC.
120120+ ///
121121+ /// For full access to the underlying DateTime, use the [`AsRef<chrono::DateTime<chrono::FixedOffset>>`] implementation.
122122+ #[inline]
123123+ #[must_use]
124124+ pub fn timestamp_ms(&self) -> i64 {
125125+ self.dt.timestamp_millis()
126126+ }
127127+128128+ /// Extracts the number of non-leap-microseconds since January 1, 1970 UTC.
129129+ ///
130130+ /// For full access to the underlying DateTime, use the [`AsRef<chrono::DateTime<chrono::FixedOffset>>`] implementation.
131131+ #[inline]
132132+ #[must_use]
133133+ pub fn timestamp_micros(&self) -> i64 {
134134+ self.dt.timestamp_micros()
108135 }
109136}
110137