Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to display +00:00 instead of Z in timezone info ?

843834Feb 4 2008 — edited Feb 4 2008
I was using Jaxb1.0/jdk1.4 in my application to convert java objects to xml. The date-time used to be output in the format 2008-02-04T15:04:48+00:00.

I upgraded to Jaxb2.0 /jdk1.5 and am getting the output in the format 2008-02-04T15:04:48. ie the timezone information is lost. I tried to do a setTimezone on the xMLGregorianCalendar object but then it returns a format with an Z (eg: 2008-01-22T01:40:00Z) appended. Of course the Z component is equivalent to the +/-aa:bb but unfortunately the other application that uses the generated xml is built to specifically extract the timezone information from the +/-aa:bb component.

Is is possible to specify that the tmz info should be displayed in the format +/-aa:bb rather than Z ?

Thanks
Sreejith
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 3 2008
Added on Feb 4 2008
0 comments
454 views