Here you can find the source of add(Date date, int x)
public static Date add(Date date, int x)
//package com.java2s; /*//ww w .j a va2 s . c om * Distributable under LGPL v3 license. * See terms of license at https://github.com/Yunfeng/schotel/blob/master/LICENSE */ import java.util.Calendar; import java.util.Date; public class Main { public static Date add(Date date, int x) { return addDays(date, x); } public static Date addDays(Date date, int x) { Calendar c = Calendar.getInstance(); c.clear(); c.setTime(date); c.add(Calendar.DATE, x); return c.getTime(); } }