- Replaced timegm with equivalent code.

Signed-off-by: Paul Beckingham <paul@beckingham.net>
This commit is contained in:
Owen Clarke 2011-06-27 22:49:37 -04:00 committed by Paul Beckingham
parent 8fbce0288e
commit 2bc8dfbfe7
2 changed files with 12 additions and 3 deletions

View file

@ -578,7 +578,16 @@ bool Nibbler::getDateISO (time_t& t)
tms.tm_min = minute;
tms.tm_sec = second;
t = timegm (&tms);
char *tz = getenv ("TZ");
setenv ("TZ", "", 1);
tzset ();
t = mktime (&tms);
if (tz)
setenv ("TZ", tz, 1);
else
unsetenv ("TZ");
tzset();
return true;
}
}