Here you can find the source of isAfterToday(Date dag)
public static boolean isAfterToday(Date dag)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static boolean isAfterToday(Date dag) { return getStartOfDay(dag) > getEndOfDay(new Date()); }//from w ww . ja v a2 s. c om public static long getStartOfDay(Date day) { Calendar startOfDay = Calendar.getInstance(); startOfDay.setTime(day); startOfDay.set(Calendar.HOUR_OF_DAY, 0); startOfDay.set(Calendar.MINUTE, 0); startOfDay.set(Calendar.SECOND, 0); startOfDay.set(Calendar.MILLISECOND, 0); return startOfDay.getTimeInMillis(); } public static long getEndOfDay(Date day) { Calendar endOfDay = Calendar.getInstance(); endOfDay.setTime(day); endOfDay.set(Calendar.HOUR_OF_DAY, 23); endOfDay.set(Calendar.MINUTE, 59); endOfDay.set(Calendar.SECOND, 59); endOfDay.set(Calendar.MILLISECOND, 0); return endOfDay.getTimeInMillis(); } }