Here you can find the source of isToday(int dateInt)
public static boolean isToday(int dateInt)
//package com.java2s; import java.util.*; public class Main { private static HashMap<Integer, Calendar> ctcMemo = new HashMap<>(); public static boolean isToday(int dateInt) { Calendar nowCal = GregorianCalendar.getInstance(); nowCal.setTime(new Date()); Calendar compareCal = convertToCal(dateInt); return nowCal.get(Calendar.DAY_OF_MONTH) == compareCal.get(Calendar.DAY_OF_MONTH) && nowCal.get(Calendar.MONTH) == compareCal.get(Calendar.MONTH) && nowCal.get(Calendar.YEAR) == compareCal.get(Calendar.YEAR); }// ww w . j a v a 2 s. c om /** * converts dateInt to Calendar * * @param dateInt date int to convert * @return calendar value */ private static Calendar convertToCal(int dateInt) { Calendar result = ctcMemo.get(dateInt); if (result != null) { return result; } Calendar gc = new GregorianCalendar(); gc.setTime(convertToDate(dateInt)); ctcMemo.put(dateInt, gc); return gc; } /** * converts dateInto to date * * @param dateInt dateInt to be converted * @return date */ public static Date convertToDate(int dateInt) { @SuppressWarnings("deprecation") Date nd = new Date(dateInt / 10000 - 1900, (dateInt / 100) % 100 - 1, dateInt % 100); return nd; } }