Here you can find the source of getDaysEarlierDate(int days)
Parameter | Description |
---|---|
days | a parameter |
public static Date getDaysEarlierDate(int days)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { /**/*from w w w . j a v a 2 s.co m*/ * Purpose: * <br> * getDaysEarlierDate<br> * <br> * @param days * @return<br> */ public static Date getDaysEarlierDate(int days) { Calendar cal = Calendar.getInstance(); cal.add(Calendar.DAY_OF_YEAR, -(days)); return cal.getTime(); } }