Android examples for java.util:Time
Format time int value as mm:ss
//package com.java2s; import java.text.SimpleDateFormat; import java.util.GregorianCalendar; public class Main { public static String timeMMSS(int second) { GregorianCalendar gc = new GregorianCalendar(); gc.setTimeInMillis(second * 1000); SimpleDateFormat format = new SimpleDateFormat("mm:ss"); String time = format.format(gc.getTime()); return time; }//from ww w . j av a2 s . com }