• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to get user defined timezone using XMLGregorianCalendar.

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.



 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
 
rajashree loganayagi
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I done the parsing using SimpleDateFormat. After using your code it works fine now.

Thank you.
 
reply
    Bookmark Topic Watch Topic
  • New Topic