next Day and return as Calendar - Android java.util

Android examples for java.util:Day

Description

next Day and return as Calendar

Demo Code

import android.text.TextUtils;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;

public class Main{

    public static Date nextDay(Date date) {
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(date);//from w  w w  .  ja v  a2 s. c  o m
        calendar.add(calendar.DATE, 1);
        date = calendar.getTime();
        return date;
    }

}

Related Tutorials