Commit 3b7f6641 authored by Max Kellermann's avatar Max Kellermann

TimePrint: std::chrono::system_clock support

parent 781487c4
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#ifndef MPD_TIME_PRINT_HXX #ifndef MPD_TIME_PRINT_HXX
#define MPD_TIME_PRINT_HXX #define MPD_TIME_PRINT_HXX
#include <chrono>
#include <time.h> #include <time.h>
class Response; class Response;
...@@ -30,4 +32,11 @@ class Response; ...@@ -30,4 +32,11 @@ class Response;
void void
time_print(Response &r, const char *name, time_t t); 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));
}
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment