Here you can find the source of getNextSendTime(Date sendDate, Date start)
public static Date getNextSendTime(Date sendDate, Date start)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getNextSendTime(Date sendDate, Date start) { Calendar calendar = Calendar.getInstance(); if (sendDate != null) { calendar.setTime(sendDate);//from w w w .java 2 s. c o m } Calendar startCalendar = Calendar.getInstance(); if (start == null) { startCalendar.set(Calendar.HOUR_OF_DAY, 8); startCalendar.set(Calendar.MINUTE, 0); startCalendar.set(Calendar.SECOND, 0); } else { startCalendar.setTime(start); } calendar.add(Calendar.DATE, 1); calendar.set(Calendar.HOUR_OF_DAY, startCalendar.get(Calendar.HOUR_OF_DAY)); calendar.set(Calendar.MINUTE, startCalendar.get(Calendar.MINUTE)); calendar.set(Calendar.SECOND, startCalendar.get(Calendar.SECOND)); return calendar.getTime(); } }