Here you can find the source of getTodayLastSecond()
public static Date getTodayLastSecond()
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getTodayLastSecond() { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH); int day = calendar.get(Calendar.DAY_OF_MONTH); calendar.set(year, month, day, 23, 59, 59); return calendar.getTime(); }// w w w . jav a 2 s . c o m }