Java Day End isValidSendDate(Date sendDate)

Here you can find the source of isValidSendDate(Date sendDate)

Description

is Valid Send Date

License

Open Source License

Declaration

public static boolean isValidSendDate(Date sendDate) 

Method Source Code

//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*/
}

Related

  1. isMoreThenMonth(Date startDate, Date enDate)
  2. isNowBetween(Date start, Date end)
  3. isSameDay(Calendar cal1, Calendar cal2)
  4. isSameDay(final Calendar calendar1, final Calendar calendar2)
  5. isTodayWithinPeriod(Date periodStart, Date periodEnd)
  6. isWorkingDay(final Calendar calendar, final Long[] holidays)
  7. postponeWorkingDay(final Calendar calendar, final int measureUnit, final int amount, final Long[] holidays)
  8. previousWorkingDay(final Calendar calendar, final Long[] holidays)
  9. secondsBetween(Date start, Date end, boolean assumeSameDate, boolean assumeSameHour)