Skip to content

Commit

Permalink
ofdb-boundary: add UnixTimeSeconds::as_i64
Browse files Browse the repository at this point in the history
  • Loading branch information
flosse committed Oct 9, 2024
1 parent 314042e commit 9ce7bd5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ofdb-boundary/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ pub struct UnixTimeMillis(i64);
#[cfg_attr(feature = "extra-derive", derive(Debug, Clone, Copy, Eq, PartialEq))]
pub struct UnixTimeSeconds(i64);

impl UnixTimeSeconds {
pub const fn as_i64(&self) -> i64 {
self.0
}
}

impl From<time::OffsetDateTime> for UnixTimeSeconds {
fn from(from: time::OffsetDateTime) -> Self {
Self(from.unix_timestamp())
Expand Down

0 comments on commit 9ce7bd5

Please sign in to comment.