From 9b9dca860784299527c6567ef26c170356dda613 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Sun, 26 Jul 2020 05:53:05 -0700 Subject: [PATCH] Fix string to time conversion --- Utils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Utils.cpp b/Utils.cpp index 0936478..873f2d9 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -413,6 +413,9 @@ time_t CUtils::parseTime(const std::string str) { struct tm stm; strptime(str.c_str(), "%Y-%m-%d %H:%M:%S", &stm); - return mktime(&stm); + time_t t = mktime(&stm) + stm.tm_gmtoff; + if(!stm.tm_isdst) + t += 3600; + return t; }