Top Description Methods
org.apache.xerces.xs.datatypes

public Interface XSDateTime

Known Direct Implementers
org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.DateTimeData
Imports
javax.xml.datatype.Duration, .XMLGregorianCalendar

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

Author
Ankit Pasricha, IBM
Version
$Id: XSDateTime.java 447250 2006-09-18 05:27:17Z mrglavas $

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

days - cannot be negative;
getDays
()

public Duration

Returns:

a Duration (if applicable otherwise null)
getDuration
()

public int

Returns:

hours - cannot be negative;
getHours
()

public String

Returns:

the original lexical value
getLexicalValue
()

public int

Returns:

minutes - cannot be negative;
getMinutes
()

public int

Returns:

months - can be negative only for duration types; For duration types, it returns years*12 + months
getMonths
()

public double

Returns:

seconds - can be negative only for durations; For duration types, it returns days*24*3600 + hours*3600 + minutes*60 + seconds
getSeconds
()

public int

Returns:

timezone hours (for GMT-xx:xx this will be negative),
getTimeZoneHours
()

public int

Returns:

timezone minutes (for GMT-xx:xx this will be negative),
getTimeZoneMinutes
()

public XMLGregorianCalendar

Returns:

an un-normalized XMLGregorianCalendar (if applicable otherwise null)
getXMLGregorianCalendar
()

public int

Returns:

years - can be negative for date-time related types;
getYears
()

public boolean

Returns:

boolean (true when timezone is specified in the original lexical value)
hasTimeZone
()

public boolean

Returns:

whether a date-time related object is normalized or not (value is not useful for types where timezone is not specified)
isNormalized
()

public XSDateTime

Returns:

a new date-time related object with normalized values (has no effect on objects already normalized)
normalize
()

Method Detail

getDaysback to summary
public int getDays()
Returns:int

days - cannot be negative;

getDurationback to summary
public Duration getDuration()
Returns:Duration

a Duration (if applicable otherwise null)

getHoursback to summary
public int getHours()
Returns:int

hours - cannot be negative;

getLexicalValueback to summary
public String getLexicalValue()
Returns:String

the original lexical value

getMinutesback to summary
public int getMinutes()
Returns:int

minutes - cannot be negative;

getMonthsback to summary
public int getMonths()
Returns:int

months - can be negative only for duration types; For duration types, it returns years*12 + months

getSecondsback to summary
public double getSeconds()
Returns:double

seconds - can be negative only for durations; For duration types, it returns days*24*3600 + hours*3600 + minutes*60 + seconds

getTimeZoneHoursback to summary
public int getTimeZoneHours()
Returns:int

timezone hours (for GMT-xx:xx this will be negative),

getTimeZoneMinutesback to summary
public int getTimeZoneMinutes()
Returns:int

timezone minutes (for GMT-xx:xx this will be negative),

getXMLGregorianCalendarback to summary
public XMLGregorianCalendar getXMLGregorianCalendar()
Returns:XMLGregorianCalendar

an un-normalized XMLGregorianCalendar (if applicable otherwise null)

getYearsback to summary
public int getYears()
Returns:int

years - can be negative for date-time related types;

hasTimeZoneback to summary
public boolean hasTimeZone()
Returns:boolean

boolean (true when timezone is specified in the original lexical value)

isNormalizedback to summary
public boolean isNormalized()
Returns:boolean

whether a date-time related object is normalized or not (value is not useful for types where timezone is not specified)

normalizeback to summary
public XSDateTime normalize()
Returns:XSDateTime

a new date-time related object with normalized values (has no effect on objects already normalized)