Here you can find the source of getSpecifiedDayTimeAfter(Date date)
public static Date getSpecifiedDayTimeAfter(Date date)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String getSpecifiedDayTimeAfter(String specifiedDay) { Calendar c = Calendar.getInstance(); Date date = null;//from w w w . j a v a2s.com try { date = new SimpleDateFormat("yy-MM-dd HH:mm:ss").parse(specifiedDay); } catch (ParseException e) { e.printStackTrace(); } c.setTime(date); int day = c.get(Calendar.DATE); c.set(Calendar.DATE, day + 1); String dayAfter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(c.getTime()); return dayAfter; } public static Date getSpecifiedDayTimeAfter(Date date) { Calendar c = Calendar.getInstance(); c.setTime(date); int day = c.get(Calendar.DATE); c.set(Calendar.DATE, day + 1); c.set(Calendar.HOUR_OF_DAY, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); return c.getTime(); } public static String parse(Date d) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); String dateStr = sdf.format(d); return dateStr; } }