Here you can find the source of isPast(String end)
public static boolean isPast(String end)
//package com.java2s; import java.util.Calendar; public class Main { public static boolean isPast(String end) { String[] splitEndStr = end.split(":"); int hrEnd = Integer.parseInt(splitEndStr[0]); int minEnd = Integer.parseInt(splitEndStr[1]); Calendar endCal = Calendar.getInstance(); endCal.set(Calendar.HOUR_OF_DAY, hrEnd); endCal.set(Calendar.MINUTE, minEnd); Calendar currentCal = Calendar.getInstance(); if (endCal.before(currentCal)) { return true; }/*from w ww .j av a 2 s . c o m*/ return false; } }