Skip to content

Commit 056887a

Browse files
committed
feat(timestamp): impl way to transform Timestamp to SystemTime
1 parent 0584c09 commit 056887a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/timestamp.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ impl From<Timestamp> for u64 {
4848
}
4949
}
5050

51+
impl From<Timestamp> for SystemTime {
52+
fn from(value: Timestamp) -> Self {
53+
Self::UNIX_EPOCH + Duration::from_nanos(value.into())
54+
}
55+
}
56+
5157
impl std::ops::Add for Timestamp {
5258
type Output = Timestamp;
5359
#[inline]

0 commit comments

Comments
 (0)