summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-02-10 23:46:57 +0100
committerMax Kellermann <max@musicpd.org>2017-02-10 23:48:21 +0100
commit3b7f6641d2d4abb53496805477a9e11d3dd98fbd (patch)
tree9d4d66a7ca600ad3de4ac2e2040e04d65afb6ca2
parent781487c4ddf3ea08d31f7889e4b1e909aa3717db (diff)
TimePrint: std::chrono::system_clock support
-rw-r--r--src/TimePrint.hxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/TimePrint.hxx b/src/TimePrint.hxx
index c98634a7a..e905473a7 100644
--- a/src/TimePrint.hxx
+++ b/src/TimePrint.hxx
@@ -20,6 +20,8 @@
#ifndef MPD_TIME_PRINT_HXX
#define MPD_TIME_PRINT_HXX
+#include <chrono>
+
#include <time.h>
class Response;
@@ -30,4 +32,11 @@ class Response;
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));
+}
+
#endif