From 5a2892f0ae6de5677b47594d02e8658d72fc0f80 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 1 Mar 2019 06:59:32 +0100 Subject: [PATCH] src/bin/proxmox-backup-client.rs: use chrono::DateTime --- src/bin/proxmox-backup-client.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index dff03f24..07d4e84b 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -2,7 +2,7 @@ extern crate proxmox_backup; use failure::*; //use std::os::unix::io::AsRawFd; -use chrono::{Local, TimeZone}; +use chrono::{DateTime, Local, Utc, TimeZone}; use proxmox_backup::tools; use proxmox_backup::cli::*; @@ -31,7 +31,7 @@ fn backup_directory( repo: &BackupRepository, body: Body, archive_name: &str, - backup_time: u64, + backup_time: DateTime, chunk_size: Option, ) -> Result<(), Error> { @@ -41,7 +41,7 @@ fn backup_directory( .append_pair("archive_name", archive_name) .append_pair("type", "host") .append_pair("id", &tools::nodename()) - .append_pair("time", &backup_time.to_string()); + .append_pair("time", &backup_time.timestamp().to_string()); if let Some(size) = chunk_size { query.append_pair("chunk-size", &size.to_string()); @@ -196,8 +196,7 @@ fn create_backup( } } - let backup_time = std::time::SystemTime::now().duration_since( - std::time::SystemTime::UNIX_EPOCH)?.as_secs(); + let backup_time = Utc::now(); let mut client = HttpClient::new(&repo.host, &repo.user);