Here you can find the source of getLastDay()
private static String getLastDay()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { private static String getLastDay() { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar = Calendar.getInstance(); Date theDate = calendar.getTime(); String s = df.format(theDate); StringBuffer str = new StringBuffer().append(s).append(" 23:59:59"); return str.toString(); }//from w w w .j ava 2 s.c om }