Possible Duplicate:
how to convert milliseconds to date format in android?
I have a Milliseconds String and want to convert it to a Date String.
Like this:
Milliseconds: 1345032624325E12 -> Date: Wed Aug 15 2012 14:10:24
How can i do this?
Possible Duplicate:
how to convert milliseconds to date format in android?
I have a Milliseconds String and want to convert it to a Date String.
Like this:
Milliseconds: 1345032624325E12 -> Date: Wed Aug 15 2012 14:10:24
How can i do this?
Hope this helps how to convert milliseconds to date format in android?
private String getDate(long milliSeconds, String dateFormat)
{
// Create a DateFormatter object for displaying date in specified format.
DateFormat formatter = new SimpleDateFormat(dateFormat);
// Create a calendar object that will convert the date and time value in milliseconds to date.
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(milliSeconds);
return formatter.format(calendar.getTime());
}