diff options
author | rsc <devnull@localhost> | 2004-04-20 17:00:01 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-04-20 17:00:01 +0000 |
commit | dddc2ed156bd5a089b737d9abfd97820b4b0dc17 (patch) | |
tree | 03d3988721d0253da4265e98702e3c3ae9094331 | |
parent | 99c75f3c503b7b3d667c251e90170bf7e10037ce (diff) | |
download | plan9port-dddc2ed156bd5a089b737d9abfd97820b4b0dc17.tar.gz plan9port-dddc2ed156bd5a089b737d9abfd97820b4b0dc17.tar.bz2 plan9port-dddc2ed156bd5a089b737d9abfd97820b4b0dc17.zip |
Compute time zone using strftime.
-rw-r--r-- | src/lib9/date.c | 5 |
1 files changed, 2 insertions, 3 deletions
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){ |