Bug
- Fixed bug where ISO dates were parsed and the TZ was modified, which should have no bearing on a Zulu time.
This commit is contained in:
@@ -694,24 +694,16 @@ bool Nibbler::getDateISO (time_t& t)
|
||||
|
||||
// Convert to epoch.
|
||||
struct tm tms = {0};
|
||||
tms.tm_isdst = -1; // Requests that mktime determine summer time effect.
|
||||
tms.tm_mday = day;
|
||||
tms.tm_mon = month - 1;
|
||||
tms.tm_year = year - 1900;
|
||||
tms.tm_hour = hour;
|
||||
tms.tm_min = minute;
|
||||
tms.tm_sec = second;
|
||||
|
||||
char *tz = getenv ("TZ");
|
||||
setenv ("TZ", "UTC", 1);
|
||||
tzset ();
|
||||
t = mktime (&tms);
|
||||
if (tz)
|
||||
setenv ("TZ", tz, 1);
|
||||
else
|
||||
unsetenv ("TZ");
|
||||
tzset();
|
||||
tms.tm_isdst = -1; // Requests that mktime determine summer time effect.
|
||||
tms.tm_mday = day;
|
||||
tms.tm_mon = month - 1;
|
||||
tms.tm_year = year - 1900;
|
||||
tms.tm_hour = hour;
|
||||
tms.tm_min = minute;
|
||||
tms.tm_sec = second;
|
||||
tms.tm_gmtoff = 0;
|
||||
|
||||
t = timegm (&tms);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user