Java Month getNextMonthSpe(String curYearMonth)

Here you can find the source of getNextMonthSpe(String curYearMonth)

Description

get Next Month Spe

License

Open Source License

Declaration

public static String getNextMonthSpe(String curYearMonth) 

Method Source Code

//package com.java2s;

public class Main {

    public static String getNextMonthSpe(String curYearMonth) {
        curYearMonth = curYearMonth.replace("-", "");
        String yearMonth = getNextMonth(curYearMonth);
        return yearMonth.substring(0, 4) + "-" + yearMonth.substring(4);
    }/*from  ww  w.  j ava2  s .  c o  m*/

    public static String getNextMonth(String curYearMonth) {
        int year = Integer.parseInt(curYearMonth.substring(0, 4));
        int month = Integer.parseInt(curYearMonth.substring(4));
        if (month == 12) {
            year += 1;
            month = 1;
        } else {
            month += 1;
        }

        StringBuffer strb = new StringBuffer().append(year);
        if (month > 9)
            strb.append(month);
        else
            strb.append("0").append(month);
        return strb.toString();
    }
}

Related

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