Java Month of Year getNextMonth(Calendar aCal)

Here you can find the source of getNextMonth(Calendar aCal)

Description

get Next Month

License

Apache License

Declaration

public static String getNextMonth(Calendar aCal) 

Method Source Code


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

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

public class Main {
    public static String getNextMonth(Calendar aCal) {

        DateFormat aFmt = new SimpleDateFormat("yyyy-MM-dd");

        Calendar cal = (Calendar) aCal.clone();

        cal.add(Calendar.MONTH, 1);

        return aFmt.format(cal.getTime());

    }//from   www.j a va  2s.  c  o  m

    public static String getNextMonth() throws Exception {
        Calendar now = Calendar.getInstance();
        return getNextMonth(now);

    }
}

Related

  1. getMonthOfYear(long time)
  2. getMonthOfYearFromTimestamp(long ms)
  3. getMonthStart(int year, int month)
  4. getNextiMonth(Date date, int month)
  5. getNextMonth()
  6. getNextMonth(Date nowdate, int delay)
  7. getNextMonthFirstDay(String date)
  8. getNextMonthFirstDay(T day)
  9. getNextMonthFistDay(String nowdate, String inFormat, String outFormat)