Java Date Previous getPrefixStartDate(Integer day)

Here you can find the source of getPrefixStartDate(Integer day)

Description

get Prefix Start Date

License

Open Source License

Declaration

public static Date getPrefixStartDate(Integer day) 

Method Source Code

//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;
    }
}

Related

  1. getPreDay(Date date)
  2. GetPreMonthBeginDate()
  3. getPreMonthDate(Date date, int month)
  4. getPrevDay(Date date)
  5. getPrevDueDate(int payperiod, long time)