Here you can find the source of getMinutes(final long milliseconds)
public static int getMinutes(final long milliseconds)
//package com.java2s; //License from project: Apache License import java.util.concurrent.TimeUnit; public class Main { public static final long MINUTE = TimeUnit.MINUTES.toMillis(1); public static final long HOUR = TimeUnit.HOURS.toMillis(1); public static int getMinutes(final long milliseconds) { return (int) (milliseconds % HOUR / MINUTE); }//from w w w .ja va 2s . c om }