Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { /** * Check the schedule has expired or not * * @param endDate * @return */ public static boolean hasNotExpired(Date endDate) { Calendar cal = Calendar.getInstance(); cal.add(Calendar.DAY_OF_MONTH, -1); // Check expired date return (endDate == null || cal.getTime().before(endDate)); } }