Java Day From equalsDay(final Date date1, final Date date2)

Here you can find the source of equalsDay(final Date date1, final Date date2)

Description

equals Day

License

LGPL

Declaration

public static boolean equalsDay(final Date date1, final Date date2) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.*;

public class Main {
    /**//from ww w.ja v  a2  s  .  co  m
     * MONTH=2 *
     */
    public static final int MONTH = Calendar.MONTH;
    /**
     * Year=1 *
     */
    public static final int YEAR = Calendar.YEAR;

    public static boolean equalsDay(final Date date1, final Date date2) {
        final Calendar c1 = Calendar.getInstance();
        c1.setTime(date1);
        final Calendar c2 = Calendar.getInstance();
        c2.setTime(date2);
        return c1.get(Calendar.YEAR) == c2.get(Calendar.YEAR) && c1.get(Calendar.MONTH) == c2.get(Calendar.MONTH)
                && c1.get(Calendar.DAY_OF_MONTH) == c2.get(Calendar.DAY_OF_MONTH);
    }
}

Related

  1. daysInMonthForYear(int commonMonthIndex, int yearInteger)
  2. daysOfTwo(Date date1, Date date2)
  3. daysSince(Date since)
  4. dayStartTime(int day)
  5. distanceToNowInDaysIgnoreTime(Date date)
  6. explDay(Date date)
  7. firstDayOfCentury(final int century)
  8. get23HourOfDay(Date date)
  9. getAge(Date birthDay)