Here you can find the source of getPreviousDate(Date date)
Parameter | Description |
---|---|
date | a parameter |
public static Date getPreviousDate(Date date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { /**//www. j av a 2s. co m * Get the previous date * * @author Randy Wong * @param date * @return Date */ public static Date getPreviousDate(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(java.util.Calendar.DAY_OF_YEAR, -1); return calendar.getTime(); } }