aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3_list.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-15 16:21:41 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-15 16:21:41 +0100
commit3bf2df622a070fe8f233bec6d60bd5cca995fbfc (patch)
tree65ba71d4b950208c177a96ba34b797f18e732d5b /src/api/s3_list.rs
parent097c339d981dba0420af17d30d1221181d8bf1d7 (diff)
downloadgarage-3bf2df622a070fe8f233bec6d60bd5cca995fbfc.tar.gz
garage-3bf2df622a070fe8f233bec6d60bd5cca995fbfc.zip
Time and metadata improvements
Diffstat (limited to 'src/api/s3_list.rs')
-rw-r--r--src/api/s3_list.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/api/s3_list.rs b/src/api/s3_list.rs
index 16d96a49..4d6c32bc 100644
--- a/src/api/s3_list.rs
+++ b/src/api/s3_list.rs
@@ -2,10 +2,10 @@ use std::collections::{BTreeMap, BTreeSet, HashMap};
use std::fmt::Write;
use std::sync::Arc;
-use chrono::{DateTime, NaiveDateTime, SecondsFormat, Utc};
use hyper::{Body, Response};
use garage_util::error::Error as GarageError;
+use garage_util::time::*;
use garage_model::garage::Garage;
use garage_model::object_table::*;
@@ -247,9 +247,7 @@ pub async fn handle_list(
}
for (key, info) in result_keys.iter() {
- let last_modif = NaiveDateTime::from_timestamp(info.last_modified as i64 / 1000, 0);
- let last_modif = DateTime::<Utc>::from_utc(last_modif, Utc);
- let last_modif = last_modif.to_rfc3339_opts(SecondsFormat::Millis, true);
+ let last_modif = msec_to_rfc3339(info.last_modified);
writeln!(&mut xml, "\t<Contents>").unwrap();
writeln!(
&mut xml,