Display List Of Timezones In Java

The Java TimeZone class has a method getAvailableIDs() to get the list of timezones that is supported by Java. The object returns is an array of String objects. You can then get the name of the timezone with the getDisplayName() of the timezone object.

The list of IDs contains a number of duplicates so with the variable TIMEZONE_ID_PREFIXES, the duplicates will be eliminated. This code was taken from this site. I found it pretty handy when I was working with timezone issues.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *