Here you can find the source of isToday(long lTime)
public static boolean isToday(long lTime)
//package com.java2s; import java.util.Calendar; public class Main { public static boolean isToday(long lTime) { return isDateDayEqual(lTime, System.currentTimeMillis()); }//from w w w . j a v a 2 s . com public static boolean isDateDayEqual(long lTime1, long lTime2) { Calendar cal1 = Calendar.getInstance(); cal1.setTimeInMillis(lTime1); Calendar cal2 = Calendar.getInstance(); cal2.setTimeInMillis(lTime2); return cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && cal1.get(Calendar.DAY_OF_YEAR) == cal2 .get(Calendar.DAY_OF_YEAR); } }