Here you can find the source of isToday(long milliseconds)
public static boolean isToday(long milliseconds)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static boolean isToday(long milliseconds) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(milliseconds); if (getCurrentMonth() == getMonth(milliseconds) && getCurrentDay() == getDay(milliseconds)) { return true; }//from www.j a v a 2 s .c o m return false; } public static int getCurrentMonth() { return currentDateTime(System.currentTimeMillis(), Calendar.MONTH); } public static int getMonth(long time) { return currentDateTime(time, Calendar.MONTH); } public static int getCurrentDay() { return currentDateTime(System.currentTimeMillis(), Calendar.DAY_OF_MONTH); } public static int getDay(long time) { return currentDateTime(time, Calendar.DAY_OF_MONTH); } private static int currentDateTime(long time, int type) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(time); return calendar.get(type); } }