Here you can find the source of convertOffsetToMinutesSecondsMillis(int offset)
static public String convertOffsetToMinutesSecondsMillis(int offset)
//package com.java2s; //License from project: Apache License public class Main { static public String convertOffsetToMinutesSecondsMillis(int offset) { int millis = offset; int seconds = (int) (millis / 1000); int minutes = seconds / 60; String strMillis = new String(); String strSeconds = new String(); String strMinutes = new String(); millis = millis - (seconds * 1000); seconds = seconds - (minutes * 60); if (millis < 10) { strMillis = "00" + millis; } else if (millis < 100) { strMillis = "0" + millis; } else {/*from w w w . j a va2 s . c o m*/ strMillis = "" + millis; } if (seconds < 10) { strSeconds = "0" + seconds; } else { strSeconds = "" + seconds; } strMinutes = "" + minutes; return (strMinutes + ":" + strSeconds + ":" + strMillis); } }