Fix string to time conversion

feature/AudioLoginLogoff
Geoffrey Merck 5 years ago
parent 41f38a2837
commit 9b9dca8607

@ -413,6 +413,9 @@ time_t CUtils::parseTime(const std::string str)
{ {
struct tm stm; struct tm stm;
strptime(str.c_str(), "%Y-%m-%d %H:%M:%S", &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;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.