Here you can find the source of isUpdateTimeRecently(Calendar currentTime, Calendar updateTime)
public static boolean isUpdateTimeRecently(Calendar currentTime, Calendar updateTime)
//package com.java2s; import java.util.Calendar; public class Main { private static final int INTERVAL_MINUTE_TO_UPDATE = 30; public static boolean isUpdateTimeRecently(Calendar currentTime, Calendar updateTime) { for (int i = 0; i < INTERVAL_MINUTE_TO_UPDATE; i++) { updateTime.add(Calendar.MINUTE, 1); }/*ww w . ja v a 2 s . c om*/ if (currentTime.compareTo(updateTime) == 1) { return false; } return true; } }