Java Month getNextMonth(String month)

Here you can find the source of getNextMonth(String month)

Description

get Next Month

License

Open Source License

Declaration

public static String getNextMonth(String month) 

Method Source Code

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

public class Main {

    public static String getNextMonth(String month) {
        int year = Integer.parseInt(month.substring(0, 4));
        int mon = Integer.parseInt(month.substring(4, 6));
        String nextmonth = "";
        String nextyear = String.valueOf(year);
        if (mon == 12) {
            nextmonth = "01";
            nextyear = String.valueOf(year + 1);
        } else if (mon < 9) {
            nextmonth = "0" + String.valueOf(mon + 1);
        } else {/*from   www.j a  v  a  2 s . com*/
            nextmonth = String.valueOf(mon + 1);
        }
        return nextyear + nextmonth;
    }
}

Related

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