Here you can find the source of getWeekStartDateBeforeCurrent(int weekNum, Date current)
public static long getWeekStartDateBeforeCurrent(int weekNum, Date current)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static long getWeekStartDateBeforeCurrent(int weekNum, Date current) { // delete by lijun begin // return getLatestStartOfWeek(current) - // ((long)weekNum*7*24*60*60*1000); // delete by lijun end // add by lijun begin Calendar calendar = Calendar.getInstance(); calendar.setTime(current);/*from ww w .j a v a2 s . c om*/ calendar.setFirstDayOfWeek(Calendar.MONDAY); calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); calendar.add(Calendar.DAY_OF_MONTH, -weekNum * 7); return calendar.getTimeInMillis(); // add by lijun end } }