[dev] timezone pref

Jon Parise jon@csh.rit.edu
Thu, 17 May 2001 17:13:16 -0400


On Thu, May 17, 2001 at 02:05:58PM -0700, Max Kalika wrote:

> > On Thu, May 17, 2001 at 10:14:16AM -0700, Max Kalika wrote:
> > 
> > This produces 'EDT4' on my system.  Is that valid?  I thought
> > only 'EST5EDT' would be correct for my location.
> 
> Whoops, you're right...on a solaris box this produced a time that was an hour 
> off, however:
> 
> putenv('TZ=' . sprintf("%s%d%s", date('T'), date('Z') / -3600, date('T')))
> 
> worked correctly on all the systems I tried.

That produces 'EDT4EDT' here.
 
> Anyway your fix is probably better (though having a default in
> the prefs, would show the users an example).
 
I've committed my fix, but it would be good for the user to also
see a default.  When I original worked on the time zone code, I
had a getenv('TZ') in there to set the default, but I found that
it was seldom set.

-- 
Jon Parise (jon@csh.rit.edu)  .  Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/  :  Computer Science House Member