Here you can find the source of isSameDayOfMonth(Date dt1, Date dt2)
Parameter | Description |
---|---|
dt1 | a parameter |
dt2 | a parameter |
public static boolean isSameDayOfMonth(Date dt1, Date dt2)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { /**// w w w. j a v a 2 s .com * Does it have the same day of month * @param dt1 * @param dt2 * @return */ public static boolean isSameDayOfMonth(Date dt1, Date dt2) { if (dt1 == null || dt2 == null) return false; GregorianCalendar gc1 = new GregorianCalendar(); gc1.setTime(dt1); GregorianCalendar gc2 = new GregorianCalendar(); gc2.setTime(dt2); return (gc1.get(Calendar.DAY_OF_MONTH) == gc2.get(Calendar.DAY_OF_MONTH)); } }