mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug - Default TZ not always UTC.
From Owen: I tried mktime on Darwin an Linux; looks like they both default to UTC if the TZ environment variable is unset but on Solaris it defaults to the local timezone. I compiled and ran the tests and checked the behaviour by running: date TZ="" date TZ="UTC" date On Solaris the first two are in local time and the third is in UTC. On Darwin and Linux the first one is in local time and the other two are in UTC. Found this as a reference, too, which mentions the suggested implementation in 'man 3 timegm': http://stackoverflow.com/questions/6467844/is-c-mktime-different-on-windows-and-gnu-linux Signed-off-by: Paul Beckingham <paul@beckingham.net>
This commit is contained in:
parent
afcd362f67
commit
7c90d1e8cc
2 changed files with 2 additions and 1 deletions
|
@ -234,6 +234,7 @@
|
||||||
Barton Meeks).
|
Barton Meeks).
|
||||||
+ Fixed problem with duplicate 'project changed' messages (thanks to Owen
|
+ Fixed problem with duplicate 'project changed' messages (thanks to Owen
|
||||||
Clarke).
|
Clarke).
|
||||||
|
+ Fixed problem with non-UTC defaults for "TZ" (thanks to Owen Clarke).
|
||||||
|
|
||||||
------ old releases ------------------------------
|
------ old releases ------------------------------
|
||||||
|
|
||||||
|
|
|
@ -672,7 +672,7 @@ bool Nibbler::getDateISO (time_t& t)
|
||||||
tms.tm_sec = second;
|
tms.tm_sec = second;
|
||||||
|
|
||||||
char *tz = getenv ("TZ");
|
char *tz = getenv ("TZ");
|
||||||
setenv ("TZ", "", 1);
|
setenv ("TZ", "UTC", 1);
|
||||||
tzset ();
|
tzset ();
|
||||||
t = mktime (&tms);
|
t = mktime (&tms);
|
||||||
if (tz)
|
if (tz)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue