-
Apr 16th, 2008, 07:17 AM
#1
XMLGregorianCalendar versus java.util.Date
I was ignorant of the XMLGregorianCalendar type until I saw it in the Spring WS Axis client for the airline sample. I was surprised to see this touted as a "standard".
How can it be that when there are several calendars in use around the world that XML can standardize on Gregorian in this way? They've gone to great pains to make XML support Unicode. Why just one calendar and one standard date format?
I'm working on apps for international offices these days, so I've become more aware of I18N than I would have thought possible. Still lots to learn, though.
%
-
Apr 16th, 2008, 10:32 PM
#2
XMLGregorianCalendar is based on representing time as specified in ISO8601. They had to pick one representation of dates and times in XML and that was the one they chose. Localisation issues (such as converting from ISO8601 to local calendar) should be handled by the application not the data interchange format.
-
Apr 18th, 2008, 05:40 AM
#3
<rant>
Dates and calendars are a pain in Java. So until we get JSR 310, I would suggest using the excellent Joda Time for all your date & time handling.
The only reason I don't use it by default in Spring-WS is that it's an extra dependency, and I don't want to require it.
</rant>
-
Apr 18th, 2008, 08:34 AM
#4
Thank you, Arjen. Your advice and the web services module are both most welcome.
%
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules