On Fri, Jan 20, 2006 at 10:59:50AM -0500, Garrett, Philip (MAN-Corporate) wrote:
> > -----Original Message-----
> > From: Bill Moseley [mailto:[EMAIL PROTECTED] 
> > Sent: Friday, January 20, 2006 10:26 AM
> > To: datetime@perl.org
> > Subject: Daylight Saving
> > 
> > I have a zipcode table that lists the city, state, timezone offset (eg
> > -5) and a flag indicating if the location uses daylight saving time
> > for U.S. zipcodes. I don't have the Olson name in the table.
> > 
> > How do I set the timezone in this case -- taking into account the dst
> > settings?
> 
> It looks like DateTime::TimeZone doesn't support offsets with DST.
> 
> You could use a brute force approach where you choose a single Olson
> name to go with each offset/dst combination.
> e.g. (just guessing at these)
>     GMT-0500(DST) => America/New_York
>     GMT-0500      => America/Indiana/Indianapolis
>     GMT-0800(DST) => America/Los_Angeles
>     
> Then, put that Olson name in the table and use it.
> It's not exactly elegant, but it'd probably get you what you want.

Just use the Olson

  PST8PDT
  MST7MDT
  MST
  CST6CDT
  EST5EDT
  EST

zones.  I assume there aren't PST and CST zones because they
aren't actually in use, but if they are needed, maybe you could use
DateTime::TimeZone::OffsetOnly?

Is there a reason the Olson etcetera file isn't included in DT::TZ?

Reply via email to