Skip to content

Commit 1f4598d

Browse files
authored
x509-cert: provide a Time::now method (#1761)
1 parent fb0634f commit 1f4598d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

x509-cert/src/time.rs

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ impl Time {
7979

8080
Ok(())
8181
}
82+
83+
/// Creates a `Time` from the current date.
84+
#[cfg(feature = "std")]
85+
pub fn now() -> der::Result<Self> {
86+
SystemTime::now().try_into()
87+
}
8288
}
8389

8490
impl fmt::Display for Time {

0 commit comments

Comments
 (0)