Java Utililty Methods Day Next

List of utility methods to do Day Next

Description

The list of methods to do Day Next are organized into topic(s).

Method

StringgetNextDay()
get Next Day
String operationtime = dateFormat.format(new java.util.Date(date.getTime() + 24 * 60 * 60 * 1000));
return operationtime;
DategetNextDay(Date date)
get Next Day
return addDay(date, 1);
DategetNextDay(Date date)
get Next Day
long time = date.getTime() / 1000L + 86400L;
date.setTime(time * 1000L);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
try {
    date = format.parse(format.format(date));
} catch (Exception ex) {
    System.out.println(ex.getMessage());
return date;
DategetNextDay(Date nowdate, int delay)
get Next Day
long myTime;
Calendar calendar = new GregorianCalendar();
for (int i = 0; i < delay; i++) {
    myTime = (nowdate.getTime() / 1000) + i * 24 * 60 * 60;
    calendar.setTimeInMillis(myTime);
    if (calendar.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY
            && calendar.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY) {
        nowdate.setTime(myTime * 1000);
...
StringgetNextDay(String date)
get Next Day
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
    long time = format.parse(date).getTime();
    Calendar cal = Calendar.getInstance();
    cal.setTimeInMillis(time);
    cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
    cal.add(Calendar.DAY_OF_MONTH, 1);
    return format.format(cal.getTime());
...
StringgetNextDay(String dateStr)
get Next Day
Calendar calendar = new GregorianCalendar();
String format = "yyyy-MM-dd";
if (dateStr != null && dateStr.trim().length() == 7) {
    format = "yyyy-MM";
SimpleDateFormat bartDateFormat = new SimpleDateFormat(format);
try {
    Date date = bartDateFormat.parse(dateStr);
...
StringgetNextDay(String day)
get Next Day
return getDeltaDay(day, 1);
StringgetNextDay(String nowdate, String delay)
get Next Day
try {
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    String mdate = "";
    Date d = strToDate(nowdate);
    long myTime = (d.getTime() / 1000) + Integer.parseInt(delay) * 24 * 60 * 60;
    d.setTime(myTime * 1000);
    mdate = format.format(d);
    return mdate;
...
StringgetNextDay(String nowdate, String delay)
get Next Day
try {
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    String mdate = "";
    Date d = strToDate(nowdate);
    long myTime = (d.getTime() / 1000) + Integer.parseInt(delay) * 24 * 60 * 60;
    d.setTime(myTime * 1000);
    mdate = format.format(d);
    return mdate;
...
StringgetNextDay(String nowdate, String delay)
get Next Day
try {
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    String mdate = "";
    Date d = strToDate(nowdate);
    long myTime = (d.getTime() / 1000) + Integer.parseInt(delay) * 24 * 60 * 60;
    d.setTime(myTime * 1000);
    mdate = format.format(d);
    return mdate;
...