get Minutes Seconds from int seconds value - Android java.util

Android examples for java.util:Minute

Description

get Minutes Seconds from int seconds value

Demo Code


//package com.java2s;
import android.annotation.SuppressLint;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    @SuppressLint("SimpleDateFormat")
    public static String getMinutesSeconds(int seconds) {
        return new SimpleDateFormat("mm:ss")
                .format(new Date(seconds * 1000));
    }//from  ww  w .  j  a v a  2 s .  c  om
}

Related Tutorials