Java XML Date to getNextMonthDate(GregorianCalendar calendar)

Here you can find the source of getNextMonthDate(GregorianCalendar calendar)

Description

get Next Month Date

License

Apache License

Declaration

public static XMLGregorianCalendar getNextMonthDate(GregorianCalendar calendar) throws Exception 

Method Source Code

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

import java.util.Calendar;

import java.util.GregorianCalendar;

import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;

public class Main {
    public static XMLGregorianCalendar getNextMonthDate(GregorianCalendar calendar) throws Exception {
        DatatypeFactory df = DatatypeFactory.newInstance();

        GregorianCalendar aCal = (GregorianCalendar) calendar.clone();

        aCal.add(Calendar.MONTH, 1);

        return df.newXMLGregorianCalendar(aCal);
    }//from w w  w . java 2 s . c o  m

    public static XMLGregorianCalendar getNextMonthDate() throws Exception {
        return getNextMonthDate(new GregorianCalendar());

    }
}

Related

  1. getDateFromXMLGregorianCalendar(XMLGregorianCalendar xmlGregorianCalendar)
  2. getDurationFromCalendar( final XMLGregorianCalendar cal)
  3. getGmtTimeFromXMLGregorianCalendar( XMLGregorianCalendar xgcal)
  4. getLocalTimeFromXMLGregorianCalendar( XMLGregorianCalendar xgcal)
  5. getMilliseconds(XMLGregorianCalendar xmlCalendar)
  6. toTimestamp(XMLGregorianCalendar calendar)
  7. toTimestamp(XMLGregorianCalendar xgc)
  8. toTimestamp(XMLGregorianCalendar xmlDate)