Here you can find the source of isToday(long time)
public static boolean isToday(long time)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static boolean isToday(long time) { GregorianCalendar calendar = (GregorianCalendar) Calendar .getInstance();/*from w ww. j a v a 2s . c o m*/ calendar.setTimeInMillis(System.currentTimeMillis()); int systemDay = calendar.get(Calendar.DAY_OF_MONTH); int systemMonth = calendar.get(Calendar.MONTH); int systemYear = calendar.get(Calendar.YEAR); calendar.setTimeInMillis(time); int day = calendar.get(Calendar.DAY_OF_MONTH); int month = calendar.get(Calendar.MONTH); int year = calendar.get(Calendar.YEAR); return systemDay == day && systemMonth == month && systemYear == year; } }