summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-08-19 22:21:22 +0200
committerMax Kellermann <max@musicpd.org>2019-12-16 23:03:31 +0100
commitfed9b6fd7444d9947adccb40a93d349e362bb84c (patch)
tree7d242b63b2ac56665f70b2c33745dfc6ab738871
parentb02890eb8a1b014e575efe4130793d31a5ac0bb1 (diff)
time/Parser: use TimeGm()
-rw-r--r--src/time/Parser.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/time/Parser.cxx b/src/time/Parser.cxx
index 369408efb..c4d7288b6 100644
--- a/src/time/Parser.cxx
+++ b/src/time/Parser.cxx
@@ -28,6 +28,7 @@
*/
#include "Parser.hxx"
+#include "Convert.hxx"
#include "util/Compiler.h"
#include <stdexcept>
@@ -72,13 +73,11 @@ ParseTimePoint(const char *s, const char *format)
#ifdef __GLIBC__
/* timegm() is a GNU extension */
- const auto t = timegm(&tm);
+ return TimeGm(tm);
#else
tm.tm_isdst = 0;
const auto t = mktime(&tm) + GetTimeZoneOffset();
-#endif /* !__GLIBC__ */
-
return std::chrono::system_clock::from_time_t(t);
-
+#endif /* !__GLIBC__ */
#endif /* !_WIN32 */
}