From dddc2ed156bd5a089b737d9abfd97820b4b0dc17 Mon Sep 17 00:00:00 2001 From: rsc Date: Tue, 20 Apr 2004 17:00:01 +0000 Subject: Compute time zone using strftime. --- src/lib9/date.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib9/date.c b/src/lib9/date.c index 47abaf36..58a4a889 100644 --- a/src/lib9/date.c +++ b/src/lib9/date.c @@ -34,12 +34,11 @@ tm2Tm(struct tm *tm, Tm *bigtm) bigtm->mon = tm->tm_mon; bigtm->year = tm->tm_year; bigtm->wday = tm->tm_wday; -#ifdef _HAVETMZONE - strecpy(bigtm->zone, bigtm->zone+4, tm->tm_zone); -#endif + strftime(bigtm->zone, sizeof bigtm->zone, "%Z", tm); #ifdef _HAVETZOFF bigtm->tzoff = tm->tm_gmtoff; #endif + if(bigtm->zone[0] == 0){ s = getenv("TIMEZONE"); if(s){ -- cgit v1.2.3