Here you can find the source of compareTwoDate(Date beforeDate, Date afterDate)
Parameter | Description |
---|---|
beforeDate | a parameter |
afterDate | a parameter |
public static boolean compareTwoDate(Date beforeDate, Date afterDate)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { /**//from www . j a v a 2s. co m * * @param beforeDate * @param afterDate * @return */ public static boolean compareTwoDate(Date beforeDate, Date afterDate) { if (beforeDate == null && afterDate == null) { return false; } Calendar beforeCalendar = Calendar.getInstance(); beforeCalendar.setTime(beforeDate); Calendar afterCalendar = Calendar.getInstance(); afterCalendar.setTime(afterDate); return (afterCalendar.compareTo(beforeCalendar) > 0); } }