Reputation: 432
I have get web service response in my android app in json format. In this response I need to find a date from json. I am getting date "/Date(1381363200000)/"
in this format, now to have to convert it to JAVA date object and then get a simple date like : "20-june-2013". I have done some r&d in Google I found about Gson but I be more confused. Please any body tell me how can I achieve this.
Thank you in advance...
Upvotes: 0
Views: 135
Reputation: 21730
The date is in epoch format. All you need to do, is convert it from epoch into a human readable date.
Here's an example of how to do it in Java
Date date = new Date(1381363200000);
DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
String formatted = format.format(date);
System.out.println(formatted);
HTH
Upvotes: 1