Gets minutes value from milliseconds. - Android java.util

Android examples for java.util:Millisecond

Description

Gets minutes value from milliseconds.

Demo Code


//package com.java2s;

import java.util.Calendar;

public class Main {
    /**//from   w w w.j  ava  2 s  . c  o m
     * Gets minutes value from milliseconds.
     * @param milliSeconds      Timestamp in milliseconds.
     * @return                  Minutes.
     */
    public static int getMinuteFromMilliseconds(Long milliSeconds) {
        Calendar time = Calendar.getInstance();
        time.setTimeInMillis(milliSeconds);
        return time.get(Calendar.MINUTE);
    }
}

Related Tutorials