Here you can find the source of hasTimeComponent(Date date, TimeZone timeZone)
public static boolean hasTimeComponent(Date date, TimeZone timeZone)
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { public static boolean hasTimeComponent(Date date, TimeZone timeZone) { final Calendar cal = Calendar.getInstance(); cal.setTimeZone(timeZone);// w w w .ja v a 2 s . co m cal.setTime(date); //Forces the calendar to re-calculate cal.getTime(); // only check hours and minutes return (cal.get(Calendar.HOUR_OF_DAY) != 0) || (cal.get(Calendar.MINUTE) != 0); } }