Compute time zone using strftime.
This commit is contained in:
parent
99c75f3c50
commit
dddc2ed156
@ -34,12 +34,11 @@ tm2Tm(struct tm *tm, Tm *bigtm)
|
|||||||
bigtm->mon = tm->tm_mon;
|
bigtm->mon = tm->tm_mon;
|
||||||
bigtm->year = tm->tm_year;
|
bigtm->year = tm->tm_year;
|
||||||
bigtm->wday = tm->tm_wday;
|
bigtm->wday = tm->tm_wday;
|
||||||
#ifdef _HAVETMZONE
|
strftime(bigtm->zone, sizeof bigtm->zone, "%Z", tm);
|
||||||
strecpy(bigtm->zone, bigtm->zone+4, tm->tm_zone);
|
|
||||||
#endif
|
|
||||||
#ifdef _HAVETZOFF
|
#ifdef _HAVETZOFF
|
||||||
bigtm->tzoff = tm->tm_gmtoff;
|
bigtm->tzoff = tm->tm_gmtoff;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(bigtm->zone[0] == 0){
|
if(bigtm->zone[0] == 0){
|
||||||
s = getenv("TIMEZONE");
|
s = getenv("TIMEZONE");
|
||||||
if(s){
|
if(s){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user