Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static boolean areSameHoursAndMinuts(Calendar c1, Calendar c2) { if (c1 == null || c2 == null) { return false; } int t1, t2; t1 = c1.get(Calendar.HOUR_OF_DAY); t2 = c2.get(Calendar.HOUR_OF_DAY); t1 = t1 * c1.get(Calendar.MINUTE); t2 = t2 * c2.get(Calendar.MINUTE); if (t1 == t2) { return true; } return false; } }