Here you can find the source of getMinutesSinceStartOfDay()
public static int getMinutesSinceStartOfDay()
//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;// www .j a v a 2s . c om } 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; } }