Java tutorial
//package com.java2s; //License from project: LGPL public class Main { public static String formatHoursAndMinutes(int totalMinutes) { String minutes = Integer.toString(totalMinutes % 60); minutes = minutes.length() == 1 ? "0" + minutes : minutes; return (totalMinutes / 60) + ":" + minutes; } }