Here you can find the source of getTodayEndTime()
public static long getTodayEndTime()
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final String FORMAT_DATE_YYYY_MM_DD = "yyyy-MM-dd"; private static final String FORMAT_DATE_AND_TIME_YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm"; public static long getTodayEndTime() { Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat(FORMAT_DATE_YYYY_MM_DD); String strDate = sdf.format(date); Date date2 = null;/*from w w w . j a va2 s . com*/ try { date2 = sdf.parse(strDate); SimpleDateFormat sdf2 = new SimpleDateFormat( FORMAT_DATE_AND_TIME_YYYY_MM_DD_HH_MM); String strDate2 = sdf2.format(date2); Date date3 = sdf2.parse(strDate2); return date3.getTime() + 86399000; } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } return 0; } }