Tuesday, October 29, 2013

Timezone and DST

A list of US 'time zone IDs' for use with java.util.TimeZone
If you program in Java and have to convert dates and times between different timezones then you will know that the Date, Calendar & TimeZone objects of the java.util package are the way to go.The JavaDoc for java.util.TimeZone mentions that you can use a 'time zone ID'of "America/Los_Angeles" to get the US Pacific Time. It doesn't give examples of any other time zone ID, so here is a list of the standard US time zone IDs:
:
Area Standard DST Std Abbrev DST Abbrev Zone Name
Eastern Time UTC-5 UTC-4 EST EDT America/New_York
Central Time UTC-6 UTC-5 CST CDT America/Chicago
Mountain Time UTC-7 UTC-6 MST MDT America/Denver
Mountain Time (no DST) UTC-7 MST America/Phoenix
Pacific Time UTC-8 UTC-7 PST PDT America/Los_Angeles
Alaska Time UTC-9 UTC-8 AST ADT America/Anchorage
Hawaii-Aleutian Time UTC-10 UTC-9 HST HDT America/Adak
Hawaii-Aleutian Time (no DST) UTC-10 HST Pacific/Honolulu

Note:Daylight Saving Time runs from the first Sunday in April at 02:00 until the last Sunday in October at 02:00 in all zones.(Table sourced from Statoids: Time Zones of the United States.)

No comments:

Post a Comment