Here you can find the source of firstDateAfterAddWeeks(Date early, int weeks)
public static final Date firstDateAfterAddWeeks(Date early, int weeks)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { public static final Date firstDateAfterAddWeeks(Date early, int weeks) { Date firstDate = getThisweekFirst(early); firstDate = dayAdd(firstDate, weeks * 7); return firstDate; }/*from ww w. j a v a 2s . c o m*/ public static final Date getThisweekFirst(Date early) { Calendar c1 = Calendar.getInstance(); c1.setTime(early); int week = c1.get(Calendar.DAY_OF_WEEK); int firstw = -1 * (week - 1); Date weekFirst = dayAdd(early, firstw); return weekFirst; } public static Date dayAdd(Date date, int days) { Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); cal.setTime(date); cal.add(Calendar.DATE, days); return cal.getTime(); } }