From d6adc59265494a547478dba1d100cdfafa8bab19 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 13 May 2024 10:36:15 +0200 Subject: [PATCH] test/run_storage: use FormatISO8601() --- test/run_storage.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/run_storage.cxx b/test/run_storage.cxx index 38413a3dd..5c6a54cef 100644 --- a/test/run_storage.cxx +++ b/test/run_storage.cxx @@ -7,8 +7,10 @@ #include "storage/FileInfo.hxx" #include "net/Init.hxx" #include "time/ChronoUtil.hxx" +#include "time/ISO8601.hxx" #include "util/PrintException.hxx" #include "util/StringAPI.hxx" +#include "util/StringBuffer.hxx" #include #include @@ -17,7 +19,6 @@ #include #include #include -#include static std::unique_ptr MakeStorage(EventLoop &event_loop, const char *uri) @@ -53,17 +54,10 @@ Ls(Storage &storage, const char *path) break; } - char mtime_buffer[32]; + StringBuffer<64> mtime_buffer; const char *mtime = " "; if (!IsNegative(info.mtime)) { - time_t t = std::chrono::system_clock::to_time_t(info.mtime); - strftime(mtime_buffer, sizeof(mtime_buffer), -#ifdef _WIN32 - "%Y-%m-%d", -#else - "%F", -#endif - gmtime(&t)); + mtime_buffer = FormatISO8601(info.mtime); mtime = mtime_buffer; }