nikhilgupta10 / GridLAB-D

Other
1 stars 0 forks source link

#538 default timezone does not use UTC0 when timezone=0 and daylight=0, #2284

Closed nikhilgupta10 closed 8 years ago

nikhilgupta10 commented 8 years ago

There should be a check to see if timezone=0 and daylight=0 and if so, the guess should be /UTC0. When this happens, the value of _tzname on Macs is \WILDABBR\, which makes no sense but there it is. Why tzname isn't set on Macs is another problem that needs to be looked at.

The code should look like this (after including the fix from ticket:537):

                lock(&tzlock);
                if (_timezone % 60 == 0){
                        sprintf(guess, \%s%d%s\, _tzname[0], (int)(_timezone / 3600), _daylight?_tzname[1]:\);
                } else {
                        sprintf(guess, \%s%d:%d%s\, _tzname[0], (int)(_timezone / 3600), (int)(_timezone / 60), _daylight?_tzname[1]:\);
                }
                if (_timezone==0 && _daylight==0)
                        tz_name=/UTC0\;
                else
                        tz_name = guess;
                unlock(&tzlock);

Also not that the unlock call must come after the tz_name set.

,

nikhilgupta10 commented 8 years ago

nikhilgupta10 imported these comments from Sourceforge: The user dchassin does not exist anymore. Therefore assigning this to afisher1. "mhauer": * status changed from new to accepted

Firefox and Thunderbird had a similar problem, as detailed by the thread at https://bugzilla.mozilla.org/show_bug.cgi?id=411726

,

"dchassin": * owner changed from mhauer to dchassin ,

"dchassin":Status? This does not seem to happen on trunk anymore.

,

"dchassin": * version changed from 2.1 to trunk ,

"dchassin": * status changed from accepted to assigned ,

"dchassin": * priority changed from minor to validate ,

"dchassin": * priority changed from validate to minor

This no longer occurs on Macs under V3.

,