Here you can find the source of getPreviousMonday(Date date, int days)
public static String getPreviousMonday(Date date, int days)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static String getPreviousMonday(Date date, int days) { int weeks = -1; GregorianCalendar currentDate = new GregorianCalendar(); currentDate.setTime(date);/*from w ww .j a va2s . c o m*/ currentDate.add(GregorianCalendar.DATE, days + 7 * weeks); Date monday = currentDate.getTime(); DateFormat df = DateFormat.getDateInstance(); String preMonday = df.format(monday); return preMonday; } }