Here you can find the source of isEndOfDay(GregorianCalendar cal1)
public static boolean isEndOfDay(GregorianCalendar cal1)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.GregorianCalendar; public class Main { public static final String STRING_EMPTY = ""; public static final String END_OF_DAY = "23:59"; public static SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm"); public static boolean isEndOfDay(GregorianCalendar cal1) { return guiTimeFormat(cal1).equals(END_OF_DAY); }//from w w w . jav a2 s . com /** * Formats a calendar object into a specified time format * * @param calendar * @return time in HH:mm format */ public static String guiTimeFormat(GregorianCalendar calendar) { if (calendar == null) { return STRING_EMPTY; } return timeFormat.format(calendar.getTime()); } }