0

I am using Simple XML for XML serialization in my Android project. I have problem with parsing a Date object. I receive an exception:

Unparseable date: 2012-05-01T08:22:34+02:00

Can anyone help me how to tell Simple XML what the date format is? Thanks.

quietmint
  • 13,885
  • 6
  • 48
  • 73
Filip Majernik
  • 7,700
  • 13
  • 45
  • 53

2 Answers2

3

SimpleXML only supports some DateFormat's, but you can use a custom Transform for Dates.

Try my example i posted here: Parse date with SimpleFramework

Community
  • 1
  • 1
ollo
  • 24,797
  • 14
  • 106
  • 155
0

You have a timezone at the end of your date. Java can parse timezone offsets, but without the ยด:' divider between. So if your date timezone were +0200 instead of +02:00, it should work. You could run it through a SimpleDateFormatter.

tolgap
  • 9,629
  • 10
  • 51
  • 65