Java Day Compare isSameDay(Date day1, Date day2)

Here you can find the source of isSameDay(Date day1, Date day2)

Description

is Same Day

License

Open Source License

Declaration

public static boolean isSameDay(Date day1, Date day2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static boolean isSameDay(Date day1, Date day2) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String ds1 = sdf.format(day1);
        String ds2 = sdf.format(day2);
        if (ds1.equals(ds2)) {
            return true;
        } else {/*from   www  .  j a va  2 s .c  o  m*/
            return false;
        }
    }
}

Related

  1. isSameDay(Date date1, Date date2)
  2. isSameDay(Date date1, Date date2)
  3. isSameDay(Date date1, Date date2)
  4. isSameDay(Date date1, Date date2)
  5. isSameDay(Date day1, Date day2)
  6. isSameDay(Date preDate, Date postDate)
  7. isSameDay(final Date date1, final Date date2)
  8. isSameDay(final Date date1, final Date date2)
  9. sameDay(Date d1, Date d2)