标签云

微信群

扫码加入我们

WeChat QR Code

This question already has an answer here:How do I format a Microsoft JSON date?40 answersI'm working on getting Json objects from a service to a List View in Android... the date format looks like this "/Date(1354222800000+0300)/" ... how can I change it to a readable format?for (int i = 0; i < json.length(); i++) {HashMap<String, String> map = new HashMap<String, String>();JSONObject e = json.getJSONObject(i);map.put("mDate", "" + e.getString("mDate"));mylist.add(map);}


is there on documentation what this format means? [+0300 quite sure means GMT + 3h]

2019年07月24日05分33秒

use "substring" to extract the datetimemillis (always 13 numbers) or use regexp.

2019年07月24日05分33秒

i found this answer stackoverflow.com/questions/7103792/…

2019年07月24日05分33秒

yeah, i know it in java script :) but im new in android development and i want to change the format into java... thanks for your answer

2019年07月24日05分33秒

This is how i found a solution to format a JSON Date to a readable format, :) :) :)

2019年07月24日05分33秒

JSONObject e = json.getJSONObject(i);

2019年07月24日05分33秒