get Time String from millisecond long value - Android java.util

Android examples for java.util:Date Time

Description

get Time String from millisecond long value

Demo Code

public class Main{

    public static String getTimeStr(long time) {
        long allmm = time / 1000;
        long mm = allmm % 60;
        return allmm / 60 + ":" + (mm < 10 ? "0" + mm : mm);
    }/*from w ww . j  a  v  a2s.  com*/

}

Related Tutorials