Here you can find the source of timeInMillisToText(final long totalTimeInMillis)
public static String timeInMillisToText(final long totalTimeInMillis)
//package com.java2s; public class Main { public static String timeInMillisToText(final long totalTimeInMillis) { final long minutes = (totalTimeInMillis / (1000 * 60)) % 60; final long hours = totalTimeInMillis / (1000 * 60 * 60); final String hoursWord = getHoursWord(Long.valueOf(hours) .intValue());/*from w w w . j a va2 s .c o m*/ final String minutesWord = getMinutessWord(Long.valueOf(minutes) .intValue()); return hours + " " + hoursWord + ", " + minutes + " " + minutesWord; } private static String getHoursWord(final int hours) { String hoursWord; if (hours == 1 || hours == 0) { hoursWord = "hour"; } else { hoursWord = "hours"; } return hoursWord; } private static String getMinutessWord(final int minutes) { String minutesWord; if (minutes == 1 || minutes == 0) { minutesWord = "minute"; } else { minutesWord = "minutes"; } return minutesWord; } }