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!

JAXB - Setting Date format in marshaller application

843834Nov 24 2003 — edited Mar 10 2004
I am using the JAXB marshaller to create content that I POST to a page on a foreign web site.

Everything looks OK other than I get my locale specific date format

<Date>2003-11-24+2:00</Date>

The foregn application doesnt recognise this date format and wants

<Date>2003/11/24</Date>

I can construct a SimpleDateFormat to do this,

DateFormat df=new SimpleDateFormat("yyyy/MM/dd");

Where and how do I tell JAXB or the marshaller to use this format?

I need to be able to customize the date format in several other places in my code as well, each remote machine has its own I18N settings, and I cannot control their format strings.

I need to run the application both as a Client(java command line application) and from within JBoss as a Servlet.

Thanks

Chris Rowse
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 7 2004
Added on Nov 24 2003
2 comments
485 views