How to parse json date, for example \/Date(1391802454790-0700)\/- (01/31/2014 11:44 AM)in Android.
API Result:
{
"Comment":"ogogog",
"CommentDate":"\/Date(1391802454790-0700)\/",
"CommentReply":[
],
"NumberOfLikes":1,
"UniqueId":"f786e0da-2e4a-430f-a37c-c60db1901e38",
"VideoId":65
}
I tried under the code, but did not display how this format is (01/31/2014 11:44 AM).
String json = "\/Date(1391802454790-0700)\/";
json=json.replace("/Date(", "").replace("-0700)/", "");
long time = Long.parseLong(json);
Date d= new Date(time);
System.out.println("Dateeee---->"+d);
source
share