Here you can find the source of getHoursAndMinutes(long dateTimeMillis)
public static String getHoursAndMinutes(long dateTimeMillis)
//package com.java2s; //License from project: Open Source License 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 . ja v a2s. c om }