Initialize the tm.tm_isdst field because it isn't set by strptime.

This commit is contained in:
A.J. Beamon 2019-03-26 09:00:45 -07:00
parent 5e03e178de
commit 1429ffe8ab
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,8 @@ std::string BackupAgentBase::formatTime(int64_t epochs) {
int64_t BackupAgentBase::parseTime(std::string timestamp) {
struct tm out;
out.tm_isdst = -1; // This field is not set by strptime. -1 tells mktime to determine whether DST is in effect
std::string timeOnly = timestamp.substr(0, 19);
// TODO: Use std::get_time implementation for all platforms once supported