This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
 
subject: Date Format With Time Zone Offset
 
Similar Threads
Parsing date using SimpleDateFormat for hh mm ss
Converting to UTC time zone
Struts2 datetimepicker
how to get the date from the string representation of date
getting wrong values using matcher.group()