Commit fed9b6fd authored by Max Kellermann's avatar Max Kellermann

time/Parser: use TimeGm()

parent b02890eb
......@@ -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 */
}
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