Java Month getPreMonth(String thisMonth)

Here you can find the source of getPreMonth(String thisMonth)

Description

get Pre Month

License

Open Source License

Declaration

public static String getPreMonth(String thisMonth) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public static String getPreMonth(String thisMonth) {

        String yearMonth[] = thisMonth.split("-");

        int month = Integer.parseInt(yearMonth[1]);
        if (month > 1) {
            return yearMonth[0] + "-" + String.format("%02d", month - 1);
        }/* w  w  w. j  av a2 s.  c o m*/

        int year = Integer.parseInt(yearMonth[0]);
        return (year - 1) + "-12";
    }
}

Related

  1. getMonthToMonth(int month)
  2. getMonthTotal(Double bsAmount, Double susAmount, Double changeRate)
  3. getNextMonth(String curYearMonth)
  4. getNextMonth(String month)
  5. getNextMonthSpe(String curYearMonth)
  6. getQuarterLastMonth(String quarter)
  7. getRSLILMonth(int month)
  8. getSecondByMonth(int month)
  9. getStatis_month()