• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps JSON Date/Time parsing...

The number before the + is a Unix timestamp in microseconds, the four digits after the + is the timezone.

See here:
Code:
TIME STAMP: 1330357200
DATE (M/D/Y @ h:m:s): 02 / 27 / 12 @ 9:40:00am EST

So one way to parse this is to extract the timestamp (if you don't care about timezone) would be something like

Code:
String ts = "/Date(1330357200000+0200)/"
int index_plus = ts.indexOf("+");
ts = ts.substring(6, index_plus - 3);
int unix_timestamp = Integer.parseInt(ts);
Date date = new Date(unix_timestamp);
 
Back
Top Bottom