Java Calendar Compare compareSameDay(Calendar first, Calendar second)

Here you can find the source of compareSameDay(Calendar first, Calendar second)

Description

compare Same Day

License

Apache License

Declaration

public static int compareSameDay(Calendar first, Calendar second) 

Method Source Code

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

import java.util.Calendar;

public class Main {
    public static int compareSameDay(Calendar first, Calendar second) {
        return (first.get(Calendar.YEAR) - second.get(Calendar.YEAR)) * 365
                + (first.get(Calendar.MONTH) - second.get(Calendar.MONTH)) * 30
                + (first.get(Calendar.DATE) - second.get(Calendar.DATE));
    }/* w  ww . j av a  2  s  .c om*/
}

Related

  1. compareCalendar(Calendar cal1, Calendar cal2)
  2. compareDates(Calendar date1, Calendar date2)
  3. compareDates(final Calendar firstCal, final Calendar secondCal)
  4. compareDateTime(final Calendar firstCal, final Calendar secondCal)
  5. compareDay(Calendar calendar, Calendar calendar1)
  6. compareTime(final Calendar firstCal, final Calendar secondCal)
  7. isEqual(Calendar calendar, Date date)
  8. isEquals(Calendar sourceDate, Calendar compareDate)
  9. isSameDate(Calendar d1, Calendar d2)