Compute time zone using strftime.
This commit is contained in:
parent
99c75f3c50
commit
dddc2ed156
1 changed files with 2 additions and 3 deletions
|
|
@ -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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue