Java Day Next getNextDay(Date date)

Here you can find the source of getNextDay(Date date)

Description

get Next Day

License

Open Source License

Declaration

public static Date getNextDay(Date date) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {

    public static Date getNextDay(Date date) {
        return addDay(date, 1);
    }/*from   www.ja  va2 s . c o  m*/

    public static Date addDay(Date date, int dayAmount) {
        if (date == null) {
            return null;
        }

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(Calendar.DATE, dayAmount);
        return calendar.getTime();
    }

    public static String getTime(Date date) {
        if (date == null) {
            return null;
        }

        SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
        return format.format(date);
    }
}

Related

  1. getNextDay()
  2. getNextDay(Date date)
  3. getNextDay(Date nowdate, int delay)
  4. getNextDay(String date)
  5. getNextDay(String dateStr)
  6. getNextDay(String day)