Java Calendar Day sameDay(Calendar a, Calendar b)

Here you can find the source of sameDay(Calendar a, Calendar b)

Description

same Day

License

Open Source License

Parameter

Parameter Description
a Calendar
b Calendar

Return

true if the Calendars describe the same day (day, month, year)

Declaration

public static boolean sameDay(Calendar a, Calendar b) 

Method Source Code

//package com.java2s;

import java.util.Calendar;

public class Main {
    /**//ww  w.j ava 2  s  .c om
     *
     * @param a
     *            Calendar
     * @param b
     *            Calendar
     * @return true if the Calendars describe the same day (day, month, year)
     */
    public static boolean sameDay(Calendar a, Calendar b) {
        return a.get(Calendar.DAY_OF_YEAR) == b.get(Calendar.DAY_OF_YEAR)
                && a.get(Calendar.MONTH) == b.get(Calendar.MONTH) && a.get(Calendar.YEAR) == b.get(Calendar.YEAR);
    }
}

Related

  1. minOfDay(Calendar calendar)
  2. moveToCalendarDay(Calendar cal, int day)
  3. moveToCalendarDayJust(Calendar cal)
  4. newCalendarForDay(Date date)
  5. resetToBeginningOfDay(Calendar c)
  6. sameDay(Calendar c1, Calendar c2)
  7. sameDay(Calendar one, Calendar two)
  8. setDayToCalendar(int days, Calendar calendar)
  9. setEndDay(Calendar cal)