test/run_storage: use FormatISO8601()
This commit is contained in:
parent
c154dc00d7
commit
d6adc59265
@ -7,8 +7,10 @@
|
|||||||
#include "storage/FileInfo.hxx"
|
#include "storage/FileInfo.hxx"
|
||||||
#include "net/Init.hxx"
|
#include "net/Init.hxx"
|
||||||
#include "time/ChronoUtil.hxx"
|
#include "time/ChronoUtil.hxx"
|
||||||
|
#include "time/ISO8601.hxx"
|
||||||
#include "util/PrintException.hxx"
|
#include "util/PrintException.hxx"
|
||||||
#include "util/StringAPI.hxx"
|
#include "util/StringAPI.hxx"
|
||||||
|
#include "util/StringBuffer.hxx"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@ -17,7 +19,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
static std::unique_ptr<Storage>
|
static std::unique_ptr<Storage>
|
||||||
MakeStorage(EventLoop &event_loop, const char *uri)
|
MakeStorage(EventLoop &event_loop, const char *uri)
|
||||||
@ -53,17 +54,10 @@ Ls(Storage &storage, const char *path)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
char mtime_buffer[32];
|
StringBuffer<64> mtime_buffer;
|
||||||
const char *mtime = " ";
|
const char *mtime = " ";
|
||||||
if (!IsNegative(info.mtime)) {
|
if (!IsNegative(info.mtime)) {
|
||||||
time_t t = std::chrono::system_clock::to_time_t(info.mtime);
|
mtime_buffer = FormatISO8601(info.mtime);
|
||||||
strftime(mtime_buffer, sizeof(mtime_buffer),
|
|
||||||
#ifdef _WIN32
|
|
||||||
"%Y-%m-%d",
|
|
||||||
#else
|
|
||||||
"%F",
|
|
||||||
#endif
|
|
||||||
gmtime(&t));
|
|
||||||
mtime = mtime_buffer;
|
mtime = mtime_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user