Java Date Equal isSameDate(long var0, long var2)

Here you can find the source of isSameDate(long var0, long var2)

Description

is Same Date

License

Apache License

Declaration

public static boolean isSameDate(long var0, long var2) 

Method Source Code


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

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

public class Main {
    public static boolean isSameDate(long var0, long var2) {
        return isSameDate(var0, var2, 5);
    }//  ww w.j a v  a 2s . c o m

    public static boolean isSameDate(long var0, long var2, int var4) {
        Calendar var5 = Calendar.getInstance();
        Calendar var6 = Calendar.getInstance();
        var5.setTime(new Date(var0));
        var6.setTime(new Date(var2));
        return var5.get(1) == var6.get(1)
                && (var4 == 1 || var5.get(2) == var6.get(2) && (var4 == 2 || var5.get(5) == var6.get(5)));
    }
}

Related

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