Java Today isBeforeToday(Date date)

Here you can find the source of isBeforeToday(Date date)

Description

is Before Today

License

Open Source License

Declaration

public static boolean isBeforeToday(Date date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    /**// w ww  .j  a v a 2 s  .c  o  m
     * Used for testing-purposes of the scheduling algorithm, where it is sometimes necessary to hack the value of
     * 'today'.
     */
    public static Date testToday;

    public static boolean isBeforeToday(Date date) {
        return date.compareTo(getToday()) < 0;
    }

    public static Date getToday() {
        if (testToday != null)
            return testToday;

        return new Date(System.currentTimeMillis());
    }
}

Related

  1. getTodayZeroHour()
  2. getTommorrow(String today)
  3. getYestoday()
  4. getYestoday(String sourceDate, String format)
  5. isBeforeToday(Date date)
  6. isGreaterThanToday(String dateString)
  7. isToday(Date d1)
  8. isToday(Date date)
  9. isToday(Date date)