William Heath wrote:
> I need to list the timezone abbreviation. For example:
>
> America/New_York EDT or EST depending on if it is DST
> America/Los_Angeles PST or PDT depending on if it is DST
>
> Is there some way for me to determine these for the timezones?
As I said:
> EST is
> (1) ambiguous (there's an EST in both America and Australia)
> (2) a 'standard' time (the 's') not a summer or daylight time
> and so the offset wont ever change
> (3) historically un-mappable to any 'proper' time zone as they
> keep changing by civil decree in various jurisdictions
However, if you had checked the DateTime documentation and you'd find
"time_zone_short_name" under "Get Methods" at
http://search.cpan.org/~drolsky/DateTime-0.42/lib/DateTime.pm#%22Get%22_Methods
Note, again however, the caveats on the DT:TZ method
(http://search.cpan.org/~drolsky/DateTime-TimeZone-0.73/lib/DateTime/TimeZone.pm#$tz-%3Eshort_name_for_datetime(_$dt_))
> Given a DateTime object, this method returns the "short name" for the
current observance and rule this datetime is in. These are names like
"EST", "GMT", etc.
>
> It is strongly recommended that you do not rely on these names for
anything other than display. These names are not official, and many of
them are simply the invention of the Olson database maintainers.
Moreover, these names are not unique. For example, there is an "EST" at
both -0500 and +1000/+1100.
William Heath wrote:
> I love perl and the DateTime module!
It's OK, you don't have to keep reassuring us!
Cheers!
Rick Measham
--
Message protected for iSite by MailGuard: e-mail anti-virus, anti-spam and
content filtering.
http://www.mailguard.com.au