Android Utililty Methods Milliseconds to Hour Convert

List of utility methods to do Milliseconds to Hour Convert

Description

The list of methods to do Milliseconds to Hour Convert are organized into topic(s).

Method

intgetHour(long dateTimeMillis)
get Hour
SimpleDateFormat format = new SimpleDateFormat("HH");
StringBuilder dateString = new StringBuilder(
        format.format(dateTimeMillis));
return Integer.parseInt(dateString.toString());
StringgetHoursAndMinutes(long dateTimeMillis)
get Hours And Minutes
String format = String.format("%%0%dd", 2);
long elapsedTime = dateTimeMillis / 1000;
String minutes = String.format(format, (elapsedTime % 3600) / 60);
String hours = String.format(format, elapsedTime / 3600);
return hours + ":" + minutes;