Here you can find the source of isFuture(int month, int year, TimeZone timeZone, Locale locale)
public static boolean isFuture(int month, int year, TimeZone timeZone, Locale locale)
//package com.java2s; /**//from w ww .j av a 2 s. co m * Genji Scrum Tool and Issue Tracker * Copyright (C) 2015 Steinbeis GmbH & Co. KG Task Management Solutions * <a href="http://www.trackplus.com">Genji Scrum Tool</a> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import java.util.Calendar; import java.util.GregorianCalendar; import java.util.Locale; import java.util.TimeZone; public class Main { public static boolean isFuture(int month, int year) { return isFuture(month, year, TimeZone.getDefault(), Locale.getDefault()); } public static boolean isFuture(int month, int year, TimeZone timeZone, Locale locale) { Calendar curCal = new GregorianCalendar(timeZone, locale); curCal.set(Calendar.DATE, 1); Calendar cal = (Calendar) curCal.clone(); cal.set(Calendar.MONTH, month); cal.set(Calendar.YEAR, year); return cal.after(curCal); } public static boolean isFuture(int month, int day, int year) { return isFuture(month, day, year, TimeZone.getDefault(), Locale.getDefault()); } public static boolean isFuture(int month, int day, int year, TimeZone timeZone, Locale locale) { Calendar curCal = new GregorianCalendar(timeZone, locale); Calendar cal = (Calendar) curCal.clone(); cal.set(Calendar.MONTH, month); cal.set(Calendar.DATE, day); cal.set(Calendar.YEAR, year); return cal.after(curCal); } public static boolean isFuture(int month, int day, int year, int hour, int minute, int amPm) { return isFuture(month, day, year, hour, minute, amPm, TimeZone.getDefault(), Locale.getDefault()); } public static boolean isFuture(int month, int day, int year, int hour, int minute, int amPm, TimeZone timeZone, Locale locale) { Calendar curCal = new GregorianCalendar(timeZone, locale); Calendar cal = (Calendar) curCal.clone(); cal.set(Calendar.MONTH, month); cal.set(Calendar.DATE, day); cal.set(Calendar.YEAR, year); cal.set(Calendar.HOUR, hour); cal.set(Calendar.MINUTE, minute); cal.set(Calendar.AM_PM, amPm); return cal.after(curCal); } }