Java Month of Year getActualMonthBefore(int year, int month, int i)

Here you can find the source of getActualMonthBefore(int year, int month, int i)

Description

get Actual Month Before

License

Open Source License

Declaration

public static String getActualMonthBefore(int year, int month, int i) 

Method Source Code


//package com.java2s;

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

public class Main {

    public static String getActualMonthBefore(int year, int month, int i) {
        SimpleDateFormat daytime = new SimpleDateFormat("yyyyMM");
        Calendar calendar = Calendar.getInstance();
        calendar.set(year, month, 1);//from   w  w w.  j av a2  s  .  c om
        calendar.set(Calendar.MONTH, calendar.get(Calendar.MONDAY) - (i + 1));
        return daytime.format(calendar.getTime());
    }
}

Related

  1. daysInMonth(int month, int year)
  2. daysInMonth(int month, int year)
  3. daysInMonth(int year, int month)
  4. daysInMonth(int year, int month)
  5. get_NextSunday_YearMonthDay_integerArray()
  6. getCalforMonth(String month, String year)
  7. getDaysByYearMonth(int year, int month)
  8. getDefaultHolidays(int year, int month)
  9. getEndOfMonth(String year, String month)