Here you can find the source of getSomedayAfterToday(int x)
public static Date getSomedayAfterToday(int x)
//package com.java2s; /*/*from w w w .j av a 2 s . c o m*/ * 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 getSomedayAfterToday(int x) { Calendar c = Calendar.getInstance(); //c.clear(Calendar.HOUR_OF_DAY); c.set(Calendar.HOUR_OF_DAY, 0); c.clear(Calendar.MINUTE); c.clear(Calendar.SECOND); c.clear(Calendar.MILLISECOND); c.add(Calendar.DAY_OF_MONTH, x); return c.getTime(); } 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(); } }