How do I add one month to current date in Java?

kiran picture kiran · Feb 5, 2011 · Viewed 229.4k times · Source

In Java how can I add one month to the current date?

Answer

Piyush Mattoo picture Piyush Mattoo · Feb 5, 2011
Calendar cal = Calendar.getInstance(); 
cal.add(Calendar.MONTH, 1);