Java Date Equal isSameDate(Date pathDate, Date now)

Here you can find the source of isSameDate(Date pathDate, Date now)

Description

is Same Date

License

Open Source License

Declaration

public static boolean isSameDate(Date pathDate, Date now) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static boolean isSameDate(Date pathDate, Date now) {
        Calendar c = Calendar.getInstance();
        c.setTime(pathDate);/* www  .  ja va 2s .c o  m*/
        Calendar nowCalendar = Calendar.getInstance();
        nowCalendar.setTime(now);
        return c.get(Calendar.DAY_OF_YEAR) == nowCalendar.get(Calendar.DAY_OF_YEAR)
                && c.get(Calendar.YEAR) == nowCalendar.get(Calendar.YEAR);
    }
}

Related

  1. isEqualDate(Date date1, Date date2)
  2. isEqualField(int field, Date d1, Date d2)
  3. isLowerEqualDate(Date date)
  4. isSameDate(Date date, Date date1)
  5. isSameDate(Date date1, Date date2)
  6. isSameDate(long var0, long var2)
  7. monthEquals(Date current, Date compare)
  8. nowInDateEquals(Date now, Date d1, Date d2)
  9. sameDate(Date date1, Date date2)