Android examples for java.util:Day
add Day to Date value
import android.content.Context; import android.provider.Settings; import android.telephony.PhoneNumberUtils; import java.io.File; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Random; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static Date addDay(Date date, int numberDay) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date);/*from w w w . j a v a 2 s .c om*/ calendar.add(Calendar.DATE, numberDay); return calendar.getTime(); } }