Forums Register Login

how to get user defined timezone using XMLGregorianCalendar.

+Pie Number of slices to send: Send
Hi,

I have a string 'date' with a value "2011-08-10T00:00:00-06:00"(Format:yyyy-MM-dd'T'HH:mm:ss+timezone). My requirement is to parse the string into the XMLGregorianCalendar where i cannot able to parse the timezone values(-06:00). It throws "NumberFormatException".

Please suggest any solution.



+Pie Number of slices to send: Send
How are you doing the parsing? Note that SimpleDateFormat does not support the ISO 8601 format that's the standard for XML properly.

This works:
+Pie Number of slices to send: Send
I done the parsing using SimpleDateFormat. After using your code it works fine now.

Thank you.
Dinner will be steamed monkey heads with a side of tiny ads.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 4612 times.
Similar Threads
Date, Calendar and TimeZones
how to set 2011-11-06T14:34:16.679+02:00 into XMLGregorianCalendar
Parsing XML datetime in Android
How to add JAXB customization to a particular element of an xsd?
Handling a strange date format
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:37:57.