Here you can find the source of getHoursAndMinutes(long dateTimeMillis)
public static String getHoursAndMinutes(long dateTimeMillis)
//package com.java2s; public class Main { public static String getHoursAndMinutes(long dateTimeMillis) { 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; }/* w w w. j a v a 2 s . c o m*/ }