Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static long getTimesEnd() { Calendar cal = Calendar.getInstance(); cal.set(Calendar.HOUR_OF_DAY, 23); cal.set(Calendar.SECOND, 59); cal.set(Calendar.MINUTE, 59); cal.set(Calendar.MILLISECOND, 999); return cal.getTimeInMillis(); } }