-1

I am getting this "createdAt":{"__type":"Date","iso":"2013-05-04T16:24:42.701Z"} as part of JSON from my backend. How can I convert it to Java Date object. in pseudo: Date d = ISODateFromJSONToJavaDate(jsonObj);

progress: is there any way to format iso type date String to java date?

Thanks!

vlio20
  • 8,955
  • 18
  • 95
  • 180
  • This is the GMT timezone, what if it is not GMT? Are zones displayed as, say, `+01:00` or `GMT+1`? Also, do you have a JSON parser yet? – fge Jun 02 '13 at 19:44
  • no I don't have it yet but I think i would use Gson – vlio20 Jun 02 '13 at 19:56

1 Answers1

0

If you are open to using a library - Joda Time might be a good candidate for handling this.

The other option is to build a SimpleDateFormat using a matching format string.

Dave G
  • 9,639
  • 36
  • 41