Here you can find the source of isAtMostNWeeksAgo(long date, int howMany)
public static boolean isAtMostNWeeksAgo(long date, int howMany)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static boolean isAtMostNWeeksAgo(long date, int howMany) { Calendar cal = Calendar.getInstance(); cal.add(Calendar.WEEK_OF_YEAR, -howMany); Date d = new Date(date); return d.after(cal.getTime()); }// w w w . j a v a 2 s .c o m }