I have a problem in displaying the date,I am getting timestamp as 1379487711 but as per this the actual time is 9/18/2013 12:31:51 PM but it displays the time as 17-41-197
I got this from here: http://www.java2s.com/Code/Android/Date-Type/CreateDatefromtimestamp.htm
None of the above answers worked for me.
Calendar c = Calendar.getInstance();
c.setTimeInMillis(Integer.parseInt(tripBookedTime) * 1000L);
Date d = c.getTime();
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy");
return sdf.format(d);
And by the way: ("dd-MM-yyyy", cal) is not recognized by Android - "Cannot resolve method".