Java examples for java.util:Day
is Calendar Same Day
//package com.java2s; import java.util.Calendar; public class Main { public static void main(String[] argv) throws Exception { Calendar a = Calendar.getInstance(); Calendar b = Calendar.getInstance(); System.out.println(isSameDay(a, b)); }// ww w. j a v a2 s .c om public static boolean isSameDay(Calendar a, Calendar b) { return (a.get(Calendar.DATE) == b.get(Calendar.DATE) && a.get(Calendar.MONTH) == b.get(Calendar.MONTH) && a .get(Calendar.YEAR) == b.get(Calendar.YEAR)); } }