Here you can find the source of DateAdd3Days(String _date)
public static String DateAdd3Days(String _date)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { private static final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); public static String DateAdd3Days(String _date) { Calendar cl = Calendar.getInstance(); Date date = null;/*from w w w .j ava2s . c o m*/ try { date = (Date) simpleDateFormat.parse(_date); } catch (ParseException e) { e.printStackTrace(); } cl.setTime(date); cl.add(Calendar.DAY_OF_YEAR, 3); date = cl.getTime(); return simpleDateFormat.format(date); } public static String DateAdd3Days(Date _date) { Calendar cl = Calendar.getInstance(); cl.setTime(_date); cl.add(Calendar.DAY_OF_YEAR, 3); _date = cl.getTime(); return simpleDateFormat.format(_date); } }