Here you can find the source of getMaxTimeMillisToday()
public static long getMaxTimeMillisToday()
//package com.java2s; import java.util.Calendar; public class Main { public static long getMaxTimeMillisToday(final Calendar calendar) { Calendar endTotalCalendar = calendar; if (endTotalCalendar == null) { endTotalCalendar = Calendar.getInstance(); }//from w w w . j a v a 2s . com endTotalCalendar.set(Calendar.HOUR_OF_DAY, 23); endTotalCalendar.set(Calendar.MINUTE, 59); endTotalCalendar.set(Calendar.SECOND, 59); return endTotalCalendar.getTimeInMillis(); } public static long getMaxTimeMillisToday() { return getMaxTimeMillisToday(Calendar.getInstance()); } }