Don't use deprecated chrono fn.
This commit is contained in:
parent
65789b0470
commit
e001d9bdba
1 changed files with 2 additions and 1 deletions
|
@ -13,7 +13,8 @@ use crate::Error;
|
|||
|
||||
impl From<KeyGenerationTime> for DateTime<Utc> {
|
||||
fn from(kg: KeyGenerationTime) -> Self {
|
||||
let naive_datetime = NaiveDateTime::from_timestamp(kg.0 as i64, 0);
|
||||
let naive_datetime = NaiveDateTime::from_timestamp_opt(kg.0 as i64, 0)
|
||||
.expect("invalid or out-of-range datetime");
|
||||
|
||||
DateTime::from_utc(naive_datetime, Utc)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue