Interface to expose the values for all date-time related types. The following table shows the methods defined for various XML Schema 1.0 built-in types. 'X' marks whether a particular method is defined for a particular type. Accessing undefined methods may return unexpected values.
| XML Schema Datatype | getYears() | getMonths() | getDays() | getHours() | getMinutes() | getSeconds() | getTimeZoneHours() | getTimeZoneMinutes() | getXMLGregorianCalendar() | getDuration() | hasTimeZone() | normalize() | isNormalized() | getLexicalValue() |
| gYear | X | - | - | - | - | - | X | X | X | - | X | X | X | X |
| gMonth | - | X | - | - | - | - | X | X | X | - | X | X | X | X |
| gDay | - | - | X | - | - | - | X | X | X | - | X | X | X | X |
| gYearMonth | X | X | - | - | - | - | X | X | X | - | X | X | X | X |
| gMonthDay | - | X | X | - | - | - | X | X | X | - | X | X | X | X |
| date | X | X | X | - | - | - | X | X | X | - | X | X | X | X |
| time | - | - | - | X | X | X | X | X | X | - | X | X | X | X |
| datetime | X | X | X | X | X | X | X | X | X | - | X | X | X | X |
| duration | - | X | - | - | - | X | - | - | - | X | - | - | - | X |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public Duration | |
| public int | |
| public String | |
| public int | |
| public int | Returns: months - can be negative only for duration types; For duration types, it returns years*12 + months
|
| public double | Returns: seconds - can be negative only for durations; For duration types, it returns days*24*3600 + hours*3600 + minutes*60 + seconds
|
| public int | |
| public int | |
| public XMLGregorianCalendar | Returns: an un-normalized XMLGregorianCalendar (if applicable otherwise null)
|
| public int | |
| public boolean | |
| public boolean | Returns: whether a date-time related object is normalized or not (value is not useful for types where timezone is not specified)
|
| public XSDateTime | Returns: a new date-time related object with normalized values (has no effect on objects already normalized)
|
| getDays | back to summary |
|---|---|
public int getDays()
| |
| getDuration | back to summary |
|---|---|
public Duration getDuration()
| |
| getHours | back to summary |
|---|---|
public int getHours()
| |
| getLexicalValue | back to summary |
|---|---|
public String getLexicalValue()
| |
| getMinutes | back to summary |
|---|---|
public int getMinutes()
| |
| getMonths | back to summary |
|---|---|
public int getMonths()
| |
| getSeconds | back to summary |
|---|---|
public double getSeconds()
| |
| getTimeZoneHours | back to summary |
|---|---|
public int getTimeZoneHours()
| |
| getTimeZoneMinutes | back to summary |
|---|---|
public int getTimeZoneMinutes()
| |
| getXMLGregorianCalendar | back to summary |
|---|---|
public XMLGregorianCalendar getXMLGregorianCalendar()
| |
| getYears | back to summary |
|---|---|
public int getYears()
| |
| hasTimeZone | back to summary |
|---|---|
public boolean hasTimeZone()
| |
| isNormalized | back to summary |
|---|---|
public boolean isNormalized()
| |
| normalize | back to summary |
|---|---|
public XSDateTime normalize()
| |