File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TimeZone Question

 
Michael Arnett
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to create a calendar object that will be set to Bermuda's current time. The questions I have are:
1. Which timezone ID to use for Bermuda?
2. Does this timezone automatically account for Daylight Savings Time?
Thanks in advance,
-MLA
 
Joel McNary
Bartender
Posts: 1824
Eclipse IDE Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bermuda is in the Atlantic Timezone. ADT (Atlantic Daylight time) should take Daylight Savings into account.
 
Tim Morrow
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One interesting thing to note is that Java has "deprecated" the use of 3-letter time zone codes, due to the ambiguity of some of them (their example is "CST" could mean "Central Standard Time" or "China Standard Time". You can read about this here:
TimeZone
Of course, in this case "ADT" is probably not ambiguous.
Anyway, the "long" form of the Bermuda time zone code is "Atlantic/Bermuda" which is UTC-4:00 and supports standard and daylight savings.
You might find it useful to list all the time zones available using TimeZone.getAvailableIDs.
Tim
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic