Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for a list of Perl supported Timezones

Status
Not open for further replies.

ajdavis

Programmer
Jun 17, 2005
14
US
I have a web gui that allows users to display all datetimes in the timezone of their choosing from a drop-down list using the following code:

$result = time2str($template, $time, $timezone);

What I am looking for is the list of acceptable timezones that can be sent in as the third parameter in the call to time2str. Is there a programatic way to retireve that list or is the list compiled on-line somewhere that I can just hard-code into an array? I've been searching, but so far, no luck. I want to display this list to the user for them to choose from. Thanks in advance for any help.
 
Sorry it has taken me so long to respond.

The time2str function can take either a timezone abbreviation or the +- offset from GMT as the third parameter, so what I have decided to do is create a hash for displaying timezone options to the user in a dropdown list. This hash will contain a pseudo time zone abbreviation (abbreviations that we will control) as the key and a descriptive string as the value for displaying in the dropdown. I will also have a second hash that uses this pseudo time zone abbreviation as the key and the GMT offset as the value. So once the user chooses the "time zone" that they want their date/times displayed in, we will use the corresponding offset to calculate the new datetime. This way it will be a little more flexible on what we can offer and hopefully lessen, if not eliminate, any clashes in timezones that use the same abbreviation.

Thanks for everyone's input.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top