aboutsummaryrefslogtreecommitdiff
path: root/src/lib9
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-05-18 23:08:02 +0000
committerrsc <devnull@localhost>2006-05-18 23:08:02 +0000
commit6452f95be69efb9ce54158b3ddb9c7c3797e652f (patch)
treea047a66f18bd23dcf10b16b8b0b7bb4648cdfd8d /src/lib9
parente0d1df6f7cef193774518a690ef9cbdebbdd0c4b (diff)
downloadplan9port-6452f95be69efb9ce54158b3ddb9c7c3797e652f.tar.gz
plan9port-6452f95be69efb9ce54158b3ddb9c7c3797e652f.tar.bz2
plan9port-6452f95be69efb9ce54158b3ddb9c7c3797e652f.zip
time zone fix
Diffstat (limited to 'src/lib9')
-rw-r--r--src/lib9/date.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib9/date.c b/src/lib9/date.c
index 87cbf694..76f4a262 100644
--- a/src/lib9/date.c
+++ b/src/lib9/date.c
@@ -44,7 +44,11 @@ tm2Tm(struct tm *tm, Tm *bigtm, int gmt)
static void
Tm2tm(Tm *bigtm, struct tm *tm)
{
- memset(tm, 0, sizeof *tm);
+ /* initialize with current time to get local time zone! (tm_isdst) */
+ time_t t;
+ time(&t);
+ *tm = *localtime(&t);
+
tm->tm_sec = bigtm->sec;
tm->tm_min = bigtm->min;
tm->tm_hour = bigtm->hour;