I’m learning Java and writing an android app that consumes a JSON object that is passed by the server.
I have it all working except the dates.
I get one of these back
'SomeKey':'\/Date(1263798000000)\/'
I am using org.json.JSONObject.
How do i convert SomeKey into a java.Util.Date?
Date format is not standard in JSON, so you need to choose how you “pass it through”. I think the value you are seeing is in millis.
In Java:
This is in my timezone, of course, but in any case it is a fairly recent date.
From the javadoc of the Date constructor:
Link to the docs here -> http://java.sun.com/javase/6/docs/api/java/util/Date.html#Date%28long%29