Java Month Format getYesterMonthDate(String format)

Here you can find the source of getYesterMonthDate(String format)

Description

get Yester Month Date

License

Apache License

Declaration

public static String getYesterMonthDate(String format) 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {

    public static String getYesterMonthDate(String format) {
        Calendar day = Calendar.getInstance();
        day.add(Calendar.MONTH, -1);
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(day.getTime());
    }//  w  w  w . j a  v a  2s .com
}

Related

  1. getFirstDayOfNextMonth(String dateFormat)
  2. getFormatCurMonthAsYYYYMM()
  3. getLastYearMonthYYYYMM()
  4. getMonthFormat(String dateString)
  5. getUpMonthDate(String date, String dateFormat)
  6. monthsBetween(String from, String to, String format)