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

@@ -478,7 +478,8 @@ async fn import_backup(
/// it can be renamed to dest_path. This guarantees that the backup is complete.
fn get_next_backup_path(folder: &Path, backup_time: i64) -> Result<(PathBuf, PathBuf, PathBuf)> {
let folder = PathBuf::from(folder);
let stem = chrono::NaiveDateTime::from_timestamp(backup_time, 0)
let stem = chrono::NaiveDateTime::from_timestamp_opt(backup_time, 0)
.context("can't get next backup path")?
// Don't change this file name format, in `dc_imex_has_backup` we use string comparison to determine which backup is newer:
.format("delta-chat-backup-%Y-%m-%d")
.to_string();