Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java check two dates same day

public static boolean isSameDay(Date date1, Date date2) {
    SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMdd");
    return fmt.format(date1).equals(fmt.format(date2));
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #java #check #dates #day
ADD COMMENT
Topic
Name
2+6 =