diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-03-27 10:31:25 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-03-27 10:44:39 +0100 |
commit | 8aeec7582ae89a1fcbc968880222afb020e80daf (patch) | |
tree | 981b0a526aff0ab04f49daa7fd7f5da86b1f4329 /openpgp/src/types/timestamp.rs | |
parent | 95289f9bbacf67b283f4ce6542407ce7280a388c (diff) |
openpgp: Implement fmt::Display for Timestamp, improve fmt::Debug.
Diffstat (limited to 'openpgp/src/types/timestamp.rs')
-rw-r--r-- | openpgp/src/types/timestamp.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/openpgp/src/types/timestamp.rs b/openpgp/src/types/timestamp.rs index a4d4f638..74a0caad 100644 --- a/openpgp/src/types/timestamp.rs +++ b/openpgp/src/types/timestamp.rs @@ -51,9 +51,15 @@ impl From<Timestamp> for Option<SystemTime> { } } +impl fmt::Display for Timestamp { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", crate::fmt::time(&SystemTime::from(*self))) + } +} + impl fmt::Debug for Timestamp { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:?}", SystemTime::from(*self)) + write!(f, "{}", self.0) } } |