Here you can find the source of isTomorrow(long lTime)
public static boolean isTomorrow(long lTime)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static boolean isTomorrow(long lTime) { return isDateDayEqual(lTime, getTimeNextDay(lTime)); }/*from w ww. j av a 2 s .c o m*/ 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); } public static long getTimeNextDay(long lTimeMillis) { Date date = new Date(lTimeMillis); Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.add(Calendar.DAY_OF_YEAR, 1); Date dateNext = cal.getTime(); return dateNext.getTime(); } }