views:

807

answers:

3

I need a way to detect the timezone of a given date object. I do NOT want the offset, nor do I want the full timezone name. I need to get the timezone abbreviation. For example, GMT, UTC, PST, MST, CST, EST, etc...

Is this possible? The closest I've gotten is parsing the result of date.toString(), but even that won't give me an abbreviation. It gives me the timezone's long name.

A: 

If all else fails, you can simply create your own hashtable with the long names and abbreviations.

Andy West
A: 

This script will do abbreviations for US timezones, but I don't know of one that handles international timezones.

Annie
A: 

Try Google's Closure Class goog.i18n.DateTimeSymbols and their locale related classes.

yannis