Here you can find the source of getPrefixStartDate(Integer day)
public static Date getPrefixStartDate(Integer day)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getPrefixStartDate(Integer day) { Date date = new Date(); if (day == null) { return date; }/* www. j a v a 2s. c o m*/ Calendar cal = Calendar.getInstance(); cal.add(Calendar.DAY_OF_MONTH, -day); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); date = cal.getTime(); return date; } }