Here you can find the source of hrColMinColSec(final long time, final boolean alwaysIncludeHours)
public static StringBuilder hrColMinColSec(final long time, final boolean alwaysIncludeHours)
//package com.java2s; import android.util.Log; public class Main { public static StringBuilder hrColMinColSec(final long time, final boolean alwaysIncludeHours) { final long seconds = (time / 1000) % 60; final StringBuilder asText = hrColMin(time, alwaysIncludeHours); asText.append(":"); if (seconds < 10) { asText.append(0);//ww w . j av a2 s .c o m } asText.append(seconds); return asText; } public static StringBuilder hrColMin(final long time, final boolean alwaysIncludeHours) { final long seconds = time / 1000; final long minutes = (seconds / 60) % 60; final long hours = (seconds / (60 * 60)) % 60; Log.i("DateTimeUtils", "hrColMin hours minutes seconds: " + hours + " : " + minutes + " : " + seconds); final StringBuilder asText = new StringBuilder(); if (alwaysIncludeHours || hours > 0) { if (hours < 10) { asText.append(0); } asText.append(hours); asText.append(":"); } if (minutes > 0) { if (minutes < 10) { asText.append(0); } asText.append(minutes); } else { asText.append("00"); } return asText; } }