Java Date to Minute getMinus1Day(Date date)

Here you can find the source of getMinus1Day(Date date)

Description

get Minus Day

License

Open Source License

Declaration

public static Date getMinus1Day(Date date) 

Method Source Code

//package com.java2s;
/*/*w ww . j  a v  a2  s. c  o m*/
 * CommonUtil.java 
 *
 * Copyright 2007 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

import java.util.Calendar;
import java.util.Date;

public class Main {

    public static Date getMinus1Day(Date date) {
        if (date == null) {
            return null;
        }
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        cal.add(Calendar.DATE, -1);
        return cal.getTime();
    }
}

Related

  1. getMinDateOfDay(Date date)
  2. getMinHour(Date date)
  3. getMins(Date date)
  4. getMinTime(Date date)
  5. getMinute(Date d)
  6. getMinute(Date d)
  7. getMinute(Date date)
  8. getMinute(Date date)