src/bin/proxmox-backup-client.rs: correctly compute duration

And format time with SecondsFormat::Secs
This commit is contained in:
Dietmar Maurer 2019-07-26 11:11:55 +02:00
parent bbf9e7e951
commit 7a6cfbd98d
1 changed files with 3 additions and 3 deletions

View File

@ -523,7 +523,7 @@ fn create_backup(
let start_time = Local::now();
println!("Starting protocol: {}", start_time.to_rfc3339());
println!("Starting protocol: {}", start_time.to_rfc3339_opts(chrono::SecondsFormat::Secs, false));
let (crypt_config, rsa_encrypted_key) = match keyfile {
None => (None, None),
@ -601,11 +601,11 @@ fn create_backup(
client.finish().wait()?;
let end_time = Local.timestamp(Local::now().timestamp(), 0);
let end_time = Local::now();
let elapsed = end_time.signed_duration_since(start_time);
println!("Duration: {}", elapsed);
println!("End Time: {}", end_time.to_rfc3339());
println!("End Time: {}", end_time.to_rfc3339_opts(chrono::SecondsFormat::Secs, false));
Ok(Value::Null)
}