GeeCON Prague 2014*
The moose likes Java in General and the fly likes Convert datetime value to EST Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Convert datetime value to EST" Watch "Convert datetime value to EST" New topic
Author

Convert datetime value to EST

Rama Krishna Ghanta
Ranch Hand

Joined: Nov 20, 2006
Posts: 59
I have an XML file in which one of the nodes has a datetime value of format '2008-08-16T23:42:00Z'. When I read the xml file, I read this datetime value as a String. How can I convert this datetime value to a EST and display it as yyyy-MM-dd HH:MI:SS?


Ram...
Travis Hein
Ranch Hand

Joined: Jun 06, 2006
Posts: 161
How about with the SimpleDateFormat

(exception handling, imports, and method bodies excluded for clarity)


Error: Keyboard not attached. Press F1 to continue.
Rama Krishna Ghanta
Ranch Hand

Joined: Nov 20, 2006
Posts: 59
Thank you very much Travis. That worked for me.
 
GeeCON Prague 2014
 
subject: Convert datetime value to EST