Here you can find the source of isValidSendDate(Date sendDate)
public static boolean isValidSendDate(Date sendDate)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static boolean isValidSendDate(Date sendDate) { // Create the calendar object for comparison GregorianCalendar now = new GregorianCalendar(); GregorianCalendar sendDateCalendar = new GregorianCalendar(); // Set the time of the test-calendar sendDateCalendar.setTime(sendDate); // Move "current time" 5 minutes into future, so we get a 5 minute fairness period now.add(Calendar.MINUTE, -5); // Do the hard work! return now.before(sendDateCalendar); }/* ww w . j a v a 2 s .com*/ }