Add getter for inner timestamp for NumericDate

This commit is contained in:
Andre Julius 2023-06-26 17:17:25 +02:00
parent 70d1ac3786
commit 9a4751ef59

View file

@ -6,6 +6,13 @@ use serde::{de, Deserialize, Deserializer};
#[derive(Deserialize, Clone, PartialEq, Eq, Debug)] #[derive(Deserialize, Clone, PartialEq, Eq, Debug)]
pub struct NumericDate(i64); pub struct NumericDate(i64);
impl NumericDate {
/// Get the underlying unix timestamp
pub fn inner(&self) -> i64 {
self.0
}
}
#[cfg(feature = "chrono")] #[cfg(feature = "chrono")]
use chrono::{DateTime, TimeZone, Utc}; use chrono::{DateTime, TimeZone, Utc};