Java TimeZone Add isAfter(int month1, int day1, int year1, int hour1, int minute1, int amPm1, int month2, int day2, int year2, int hour2, int minute2, int amPm2, TimeZone timeZone, Locale locale)

Here you can find the source of isAfter(int month1, int day1, int year1, int hour1, int minute1, int amPm1, int month2, int day2, int year2, int hour2, int minute2, int amPm2, TimeZone timeZone, Locale locale)

Description

is After

License

Open Source License

Declaration

public static boolean isAfter(int month1, int day1, int year1, int hour1, int minute1, int amPm1, int month2,
            int day2, int year2, int hour2, int minute2, int amPm2, TimeZone timeZone, Locale locale) 

Method Source Code

//package com.java2s;
/**//from  w  w w .java 2s .  c  om
 * 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 isAfter(int month1, int day1, int year1, int hour1, int minute1, int amPm1, int month2,
            int day2, int year2, int hour2, int minute2, int amPm2, TimeZone timeZone, Locale locale) {

        Calendar cal1 = new GregorianCalendar(timeZone, locale);
        cal1.set(Calendar.MONTH, month1);
        cal1.set(Calendar.DATE, day1);
        cal1.set(Calendar.YEAR, year1);
        cal1.set(Calendar.HOUR, hour1);
        cal1.set(Calendar.MINUTE, minute1);
        cal1.set(Calendar.AM_PM, amPm1);

        Calendar cal2 = new GregorianCalendar(timeZone, locale);
        cal2.set(Calendar.MONTH, month2);
        cal2.set(Calendar.DATE, day2);
        cal2.set(Calendar.YEAR, year2);
        cal2.set(Calendar.HOUR, hour2);
        cal2.set(Calendar.MINUTE, minute2);
        cal2.set(Calendar.AM_PM, amPm2);

        return cal1.after(cal2);
    }
}

Related

  1. addTimeZone(String id, double off)
  2. adjustTimeToDefaultTimezone(long time)
  3. baseFor(TimeZone tz)
  4. cal(TimeZone tz)
  5. isFuture(int month, int year, TimeZone timeZone, Locale locale)
  6. millisFromEpochToHourId(long millis, TimeZone tz)
  7. nowWithTimeZone(TimeZone timezone)
  8. removeTimeZoneOffset(long t)