Java SQL Date Month getMonthBefroe(Date date)

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

Description

get Month Befroe

License

Apache License

Declaration

public static Date getMonthBefroe(Date date) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.Date;

import java.util.Calendar;

public class Main {
    /**// w  w  w.j  av a2  s . co  m
     * 
    * get date a month before the date given
    * @param date
    * @return
    * Date  
    * @throws
     */
    public static Date getMonthBefroe(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(Calendar.MONTH, -1);
        Date date2 = new Date(calendar.getTimeInMillis());
        return date2;
    }
}

Related

  1. getMaxDayInMonth(java.sql.Date date)
  2. getMinDayInMonth(java.sql.Date date)
  3. getMonth(Date date)
  4. getMonth(final java.sql.Date date)
  5. getMonthAmount(java.sql.Date _startDate, java.sql.Date _endDate)
  6. getMonthDate(Date myDate, int month)
  7. getMonthDays(java.sql.Date date)
  8. getmonthfl(String startdate, String enddate)
  9. getMonthFromYMD(Date ymd)