| Author |
how to get user defined timezone using XMLGregorianCalendar.
|
rajashree loganayagi
Greenhorn
Joined: Apr 12, 2011
Posts: 20
|
|
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.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12956
|
|
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:
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
rajashree loganayagi
Greenhorn
Joined: Apr 12, 2011
Posts: 20
|
|
I done the parsing using SimpleDateFormat. After using your code it works fine now.
Thank you.
|
 |
 |
|
|
subject: how to get user defined timezone using XMLGregorianCalendar.
|
|
|