Convert this XMLGregorianCalendar
to a {@link GregorianCalendar}.
When this
instance has an undefined field, this conversion relies on the java.util.GregorianCalendar
default for its corresponding field. A notable difference between XML Schema 1.0 date/time datatypes and java.util.GregorianCalendar
is that Timezone value is optional for date/time datatypes and it is a required field for java.util.GregorianCalendar
. See javadoc for java.util.TimeZone.getDefault()
on how the default is determined. To explicitly specify the TimeZone
instance, see {@link #toGregorianCalendar(TimeZone,Locale,XMLGregorianCalendar)}.
Field by Field Conversion from this class to java.util.GregorianCalendar | |
---|---|
java.util.GregorianCalendar field | javax.xml.datatype.XMLGregorianCalendar field |
ERA | {@link #getEonAndYear()}.signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD |
YEAR | {@link #getEonAndYear()}.abs().intValue() * |
MONTH | {@link #getMonth()} - {@link DatatypeConstants#JANUARY} + {@link GregorianCalendar#JANUARY} |
DAY_OF_MONTH | {@link #getDay()} |
HOUR_OF_DAY | {@link #getHour()} |
MINUTE | {@link #getMinute()} |
SECOND | {@link #getSecond()} |
MILLISECOND | get millisecond order from {@link #getFractionalSecond()}* |
GregorianCalendar.setTimeZone(TimeZone) | {@link #getTimezone()} formatted into Custom timezone id |
To ensure consistency in conversion implementations, the new GregorianCalendar
should be instantiated in following manner.
timeZone
value as defined above, create a new java.util.GregorianCalendar(timeZone,Locale.getDefault())
. GregorianCalendar.setGregorianChange( new Date(Long.MIN_VALUE))
.Calendar.set(int,int)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|