Here you can find the source of isEqualOrAfterTomorrow(Date d)
public static boolean isEqualOrAfterTomorrow(Date d)
//package com.java2s; /******************************************************************************* * Copyright (c) 2008 Ralf Ebert/*w w w . j a va 2 s . c om*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Ralf Ebert - initial API and implementation *******************************************************************************/ import java.util.Calendar; import java.util.Date; public class Main { /** * Returns true if the given date equals or is after tomorrow (ignoring the * time) * * @return true if the given date is equals or after tomorrow */ public static boolean isEqualOrAfterTomorrow(Date d) { return (d != null && !d.before(getTomorrow())); } /** * Returns the date representing tomorrow (by system time) without time * * @return Date object representing tomorrow 00:00:00 */ public static Date getTomorrow() { Calendar c = Calendar.getInstance(); setZeroTime(c); c.add(Calendar.DATE, 1); return c.getTime(); } /** * Sets hour, minute, second, millisecond set to 0 for the given Calendar * object * * @param c * Calendar object */ private static void setZeroTime(Calendar c) { c.set(Calendar.HOUR_OF_DAY, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0); } }