*
The moose likes Web Services and the fly likes Independently configure date format for XML/JSON serialization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Independently configure date format for XML/JSON serialization" Watch "Independently configure date format for XML/JSON serialization" New topic
Author

Independently configure date format for XML/JSON serialization

Will Bracken
Greenhorn

Joined: Jul 30, 2012
Posts: 1
How do I configure the date format independently for each of my date fields?
For example, let's say I have a CustomerOrder class with more than 1 java.util.Date fields in it.
I need to be able to render like this:

<customerOrder>
<orderDate>2013-01-04T20:50:42.769Z</orderDate>
<user>Bob</user>
<state>CO</state>
<estShipDate>2013-01-04</estShipDate>
</customerOrder>

So one of the dates may not care about the hh:mm:ss.
i.e. I cannot format every date the same way.
Any ideas?

This is my technology stack:

- Tomcat 7
- Jersey 1.16
- Enunciate 1.26.2
- Spring 3.1.2
- Hibernate 4.1.7
- JPA 2.0.3
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Independently configure date format for XML/JSON serialization
 
Similar Threads
Convert String to Date
query a database table using a foreign key ( where) using Hibernate.
Display values in chronological order
getting wrong values using matcher.group()
Invalid field value for field "Date"