Here you can find the source of formatIntoHHMMSS(int secsIn)
public static String formatIntoHHMMSS(int secsIn)
//package com.java2s; //License from project: Open Source License public class Main { public static String formatIntoHHMMSS(int secsIn) { int hours = secsIn / 3600, remainder = secsIn % 3600, minutes = remainder / 60, seconds = remainder % 60; return ((hours < 10 ? "0" : "") + hours + ":" + (minutes < 10 ? "0" : "") + minutes + ":" + (seconds < 10 ? "0" : "") + seconds); }/*from w w w . java 2s . c o m*/ public static String formatIntoHHMMSS(long secsIn) { long hours = secsIn / 3600, remainder = secsIn % 3600, minutes = remainder / 60, seconds = remainder % 60; return ((hours < 10 ? "0" : "") + hours + ":" + (minutes < 10 ? "0" : "") + minutes + ":" + (seconds < 10 ? "0" : "") + seconds); } }