XML Schema API: Interface XSDateTime

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xerces.xs.datatypes
Interface XSDateTime

public interface XSDateTime

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

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

Method Summary
`int` | `getDays()`
`javax.xml.datatype.Duration` | `getDuration()`
`int` | `getHours()`
`java.lang.String` | `getLexicalValue()`
`int` | `getMinutes()`
`int` | `getMonths()`
`double` | `getSeconds()`
`int` | `getTimeZoneHours()`
`int` | `getTimeZoneMinutes()`
`javax.xml.datatype.XMLGregorianCalendar` | `getXMLGregorianCalendar()`
`int` | `getYears()`
`boolean` | `hasTimeZone()`
`boolean` | `isNormalized()`
`XSDateTime` | `normalize()`

Method Detail

### getYears

    public int getYears()

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

### getMonths

    public int getMonths()

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

### getDays

    public int getDays()

  Returns:
    days - cannot be negative;

### getHours

    public int getHours()

  Returns:
    hours - cannot be negative;

### getMinutes

    public int getMinutes()

  Returns:
    minutes - cannot be negative;

### getSeconds

    public double getSeconds()

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

### hasTimeZone

    public boolean hasTimeZone()

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

### getTimeZoneHours

    public int getTimeZoneHours()

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

### getTimeZoneMinutes

    public int getTimeZoneMinutes()

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

### getLexicalValue

    public java.lang.String getLexicalValue()

  Returns:
    the original lexical value

### normalize

    public XSDateTime normalize()

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

### isNormalized

    public boolean isNormalized()

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

### getXMLGregorianCalendar

    public javax.xml.datatype.XMLGregorianCalendar getXMLGregorianCalendar()

  Returns:
    an un-normalized XMLGregorianCalendar (if applicable otherwise null)

### getDuration

    public javax.xml.datatype.Duration getDuration()

  Returns:
    a Duration (if applicable otherwise null)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2007 The Apache Software Foundation. All Rights Reserved.