Android examples for java.util:Day
get Add Day to Date
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String fm5 = "yyyy-MM-dd"; public static String getAddDay(String date, int addDay) { SimpleDateFormat formatDate = new SimpleDateFormat(fm5); Date d;//from www. j a va 2s . c om Calendar c = Calendar.getInstance(); try { d = formatDate.parse(date); c.setTime(d); c.add(Calendar.DATE, addDay); } catch (ParseException e) { e.printStackTrace(); } return formatDate.format(c.getTime()); } }