Here you can find the source of getMaxTimeMillisToday(final Calendar calendar)
public static long getMaxTimeMillisToday(final Calendar calendar)
//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(); }/*w w w.ja v a 2 s. c o m*/ 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()); } }