Here you can find the source of getMinutesSinceStartOfDay(long milliseconds)
public static int getMinutesSinceStartOfDay(long milliseconds)
//package com.java2s; import java.util.Calendar; public class Main { public static int getMinutesSinceStartOfDay() { Calendar c = Calendar.getInstance(); int hours = c.get(Calendar.HOUR); int ampm = c.get(Calendar.AM_PM); if (ampm == Calendar.PM) { hours += 12;// w w w .j ava2 s. c o m } int minutes = c.get(Calendar.MINUTE); return hours * 60 + minutes; } public static int getMinutesSinceStartOfDay(long milliseconds) { Calendar c = Calendar.getInstance(); c.setTimeInMillis(milliseconds); int hours = c.get(Calendar.HOUR); int ampm = c.get(Calendar.AM_PM); if (ampm == Calendar.PM) { hours += 12; } int minutes = c.get(Calendar.MINUTE); return hours * 60 + minutes; } }