This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I am parsing an XML file which provides me Date,Time Zone for UK and US. Date is fine but the time it provides me is in the Formate 17:00:00 UK and corresponding 12:00:00 US for same event. I would like to convert the time in the Formate 12:00 PM for US and 5:00 PM for UK. Can some one help me how I can acheive this. I have a separate object which contain both this information, I tried setting the TimeZone to UK and US but didn't work any help will be appreciated
Thanks for replying, This is the XML formate which has Date,Time and TimeZone in separate attribute. Which I am populating in the separate String. <DisplayableDateTime TimeZone="ET" EventStartDate="20080507" EventStartTime="12:00:00"/> <DisplayableDateTime TimeZone="UKT" EventStartDate="20080507" EventStartTime="17:00:00"/> i.e String TimeZone = ET String StartDate =20080507 StartTime = 12:00:00 etc.....
And the idea of a "UST" is even more nonsensical. We've got four time zones in the continental US, plus at least two for Alaska and Hawaii. I'm too lazy to look up other places like Guam to see how they would change the total, or to argue about whether they should be considered. And inconsistencies in the adoption of Daylight Saving Time (evil blight on humanity that it is) make the issue even more complicated. If you want to see a 5-hour difference between the "US" and Britain, then you must mean the East Coast of the US. If you use TimeZone.getTimeZone("America/New_York"), that should work.