Don't use deprecated chrono functions

This commit is contained in:
link2xt
2022-12-03 13:45:09 +00:00
parent 08562b645e
commit 3023d3c358
7 changed files with 91 additions and 55 deletions

View File

@@ -476,7 +476,8 @@ pub async fn get_kml(context: &Context, chat_id: ChatId) -> Result<(String, u32)
fn get_kml_timestamp(utc: i64) -> String {
// Returns a string formatted as YYYY-MM-DDTHH:MM:SSZ. The trailing `Z` indicates UTC.
chrono::NaiveDateTime::from_timestamp(utc, 0)
chrono::NaiveDateTime::from_timestamp_opt(utc, 0)
.unwrap()
.format("%Y-%m-%dT%H:%M:%SZ")
.to_string()
}