Here you can find the source of isSameDay(Date lastUpgradeTime)
public static boolean isSameDay(Date lastUpgradeTime)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static boolean isSameDay(Date lastUpgradeTime) { Calendar now = Calendar.getInstance(); Calendar lastUpgrade = Calendar.getInstance(); lastUpgrade.setTime(lastUpgradeTime); if (now.get(Calendar.DATE) == lastUpgrade.get(Calendar.DATE)) { return true; }// ww w. j av a2 s . c om return false; } public static boolean isSameDay(long lastUpgradeTime) { Calendar now = Calendar.getInstance(); Calendar lastUpgrade = Calendar.getInstance(); lastUpgrade.setTimeInMillis(lastUpgradeTime); return now.get(Calendar.DATE) == lastUpgrade.get(Calendar.DATE); } }