get Tomorrow as Date - Android java.util

Android examples for java.util:Today

Description

get Tomorrow as Date

Demo Code


//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Date getTomorrow(Date from) {
        Calendar c = buildFromDate(from);
        c.add(Calendar.DATE, 1); // number of days to add
        return c.getTime();
    }/*from  w ww . j a  v  a  2  s . c  om*/

    private static Calendar buildFromDate(Date from) {
        Calendar c = Calendar.getInstance();
        c.setTime(from);
        return c;
    }
}

Related Tutorials