Here you can find the source of isTheSameDayCheckSummerTime(final Date day1, final Date day2, final boolean escapeYear)
private static boolean isTheSameDayCheckSummerTime(final Date day1, final Date day2, final boolean escapeYear)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; import java.util.concurrent.TimeUnit; public class Main { public static final long DATE = TimeUnit.DAYS.toMillis(1); private static boolean isTheSameDayCheckSummerTime(final Date day1, final Date day2, final boolean escapeYear) { final Calendar c = Calendar.getInstance(); c.setTime(day1);//from www. jav a2 s. co m final int y = c.get(Calendar.YEAR); final int m = c.get(Calendar.MONTH); final int d = c.get(Calendar.DATE); c.setTime(day2); return (escapeYear || y == c.get(Calendar.YEAR)) && m == c.get(Calendar.MONTH) && d == c.get(Calendar.DATE); } }