Java Month addMonthString(String yyyymm)

Here you can find the source of addMonthString(String yyyymm)

Description

add Month String

License

Apache License

Declaration

public static String addMonthString(String yyyymm) 

Method Source Code

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

public class Main {

    public static String addMonthString(String yyyymm) {
        String yy = yyyymm.substring(0, 4);
        String mm = yyyymm.substring(4);
        int mm_plus_1 = Integer.parseInt(mm);
        int iYY = Integer.parseInt(yy);
        mm_plus_1++;//from ww  w .  ja v a 2s .c  om
        if (mm_plus_1 > 12) {
            mm_plus_1 = 1;
            iYY++;
        }
        return String.format("%4d%02d", iYY, mm_plus_1);
    }
}

Related

  1. addMonthMark(int month, int add)
  2. adjustWeekOfMonth(int eventWeekOfMonth, int eventRealWeekOfMonth)
  3. calculateMonthlyNominalInterestRate(final double effectiveInterestRate)
  4. checkMonth(int month)
  5. createDateMonth(String dateYear)