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

Apache License

Declaration

public static boolean isSameDay(Date day1, Date day2) 

Method Source Code


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

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final DateFormat SHORT_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");

    public static boolean isSameDay(Date day1, Date day2) {
        return SHORT_DATE_FORMAT.format(day1).equals(SHORT_DATE_FORMAT.format(day2));
    }/*from  w  ww . j  a  va2  s . c o m*/
}

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 date1, Date date2)
  6. isSameDay(Date day1, Date day2)
  7. isSameDay(Date preDate, Date postDate)
  8. isSameDay(final Date date1, final Date date2)
  9. isSameDay(final Date date1, final Date date2)