diff options
author | rsc <devnull@localhost> | 2006-05-20 04:24:24 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-05-20 04:24:24 +0000 |
commit | 7f420fb3731a6adc56ab96a934c1f77ffee48e86 (patch) | |
tree | 83c5be1bde162e0381a2c1052cd1054db95761d3 /src | |
parent | 6452f95be69efb9ce54158b3ddb9c7c3797e652f (diff) | |
download | plan9port-7f420fb3731a6adc56ab96a934c1f77ffee48e86.tar.gz plan9port-7f420fb3731a6adc56ab96a934c1f77ffee48e86.tar.bz2 plan9port-7f420fb3731a6adc56ab96a934c1f77ffee48e86.zip |
more time zone fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/lib9/date.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib9/date.c b/src/lib9/date.c index 76f4a262..c299202e 100644 --- a/src/lib9/date.c +++ b/src/lib9/date.c @@ -12,12 +12,23 @@ static void dotz(void) { time_t t; + struct tm *gtm; + struct tm tm; if(didtz) return; t = time(0); - tzdelta = t - mktime(gmtime(&t)); strftime(tzone, sizeof tzone, "%Z", localtime(&t)); + tm = *localtime(&t); /* set local time zone field */ + gtm = gmtime(&t); + tm.tm_sec = gtm->tm_sec; + tm.tm_min = gtm->tm_min; + tm.tm_hour = gtm->tm_hour; + tm.tm_mday = gtm->tm_mday; + tm.tm_mon = gtm->tm_mon; + tm.tm_year = gtm->tm_year; + tm.tm_wday = gtm->tm_wday; + tzdelta = t - mktime(&tm); } static void |