Here you can find the source of equalsTime(Time time1, Time time2)
public static boolean equalsTime(Time time1, Time time2)
//package com.java2s; //License from project: LGPL import java.sql.Time; import java.util.Calendar; public class Main { public static boolean equalsTime(Time time1, Time time2) { boolean result = false; if (time1 != null && time2 != null) { Calendar calendar = Calendar.getInstance(); calendar.setTime(time1);//from w w w . j a va 2 s . c o m calendar.set(Calendar.DAY_OF_MONTH, 1); calendar.set(Calendar.MONTH, 0); calendar.set(Calendar.YEAR, 1970); calendar.set(Calendar.MILLISECOND, 0); java.util.Date date1 = calendar.getTime(); calendar.setTime(time2); calendar.set(Calendar.DAY_OF_MONTH, 1); calendar.set(Calendar.MONTH, 0); calendar.set(Calendar.YEAR, 1970); calendar.set(Calendar.MILLISECOND, 0); java.util.Date date2 = calendar.getTime(); long v1 = date1.getTime(); long v2 = date2.getTime(); result = (v1 == v2); } else if (time1 == null && time2 == null) { result = true; } return result; } }