commit 6452f95be69efb9ce54158b3ddb9c7c3797e652f
parent e0d1df6f7cef193774518a690ef9cbdebbdd0c4b
Author: rsc <devnull@localhost>
Date: Thu, 18 May 2006 23:08:02 +0000
time zone fix
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git 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;