my dog learned polymorphism*
The moose likes Web Services and the fly likes Date Format With Time Zone Offset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Date Format With Time Zone Offset" Watch "Date Format With Time Zone Offset" New topic
Author

Date Format With Time Zone Offset

David McWilliams
Ranch Hand

Joined: Mar 14, 2009
Posts: 73
I need to convert a date from one format to another, as follows:

2013-03-17T19:12:14Z -> 2013-03-17 19:12 +0100



Prints:
date 2013-01-17T09:00:00.000Z

Can anyone tell me how to get my desired format? I've tried everything.
David McWilliams
Ranch Hand

Joined: Mar 14, 2009
Posts: 73
I was unable to figure out the answer so I've tried the following:



So 2013-03-17T09:00:00Z converts to 2013-03-17 09:00 +0000
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Date Format With Time Zone Offset