diff options
-rw-r--r-- | src/TimePrint.cxx | 8 | ||||
-rw-r--r-- | src/TimePrint.hxx | 8 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/TimePrint.cxx b/src/TimePrint.cxx index a9e932a43..19115a6c6 100644 --- a/src/TimePrint.cxx +++ b/src/TimePrint.cxx @@ -22,13 +22,15 @@ #include "client/Response.hxx" void -time_print(Response &r, const char *name, time_t t) +time_print(Response &r, const char *name, + std::chrono::system_clock::time_point t) { + time_t t2 = std::chrono::system_clock::to_time_t(t); #ifdef _WIN32 - const struct tm *tm2 = gmtime(&t); + const struct tm *tm2 = gmtime(&t2); #else struct tm tm; - const struct tm *tm2 = gmtime_r(&t, &tm); + const struct tm *tm2 = gmtime_r(&t2, &tm); #endif if (tm2 == nullptr) return; diff --git a/src/TimePrint.hxx b/src/TimePrint.hxx index e905473a7..979a4d22e 100644 --- a/src/TimePrint.hxx +++ b/src/TimePrint.hxx @@ -30,13 +30,7 @@ class Response; * Write a line with a time stamp to the client. */ void -time_print(Response &r, const char *name, time_t t); - -inline void time_print(Response &r, const char *name, - std::chrono::system_clock::time_point t) -{ - time_print(r, name, std::chrono::system_clock::to_time_t(t)); -} + std::chrono::system_clock::time_point t); #endif |