Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2005 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.xml.schema
Class XMLDateTimeUtil

    java.lang.Object
      com.bea.p13n.xml.schema.XMLDateTimeUtil

public class XMLDateTimeUtil
extends Object

ISO8601 date utility. This class will read and write the correct ISO standard date, time, and timeInstant tags

Constructor Summary
`XMLDateTimeUtil()` Default constructor.

Method Summary
`static String` | `formatDate(Calendar aDate)`
`static String` | `formatDate(Date aDate)` Format a date in ISO standard.
`static String` | `formatTime(Calendar aTime)`
`static String` | `formatTime(Date aTime)` Format a time in ISO standard.
`static String` | `formatTimeInstant(Calendar aDateTime)`
`static String` | `formatTimeInstant(Date aDateTime)` Format a date-time in ISO standard.
`static String` | `getOffset(Calendar calendar)` Create a string representing the offset for the date being formatted.
`protected static StringBuffer` | `jdk14CompliantString(StringBuffer sb)` The dates we use are ISO8601 compliant, but jdk does not understand that, so we return a string buffer that understand jdk1.4 format.
`static void` | `main(String[] args)`
`static Calendar` | `readDate(String aDate)`
`static Date` | `readDateAsDate(String aDate)` Parse the xml string back into a Date.
`static Calendar` | `readTime(String aTime)`
`static Date` | `readTimeAsDate(String aTime)` Parse the time back into a Date.
`static Calendar` | `readTimeInstant(String aDateTime)`
`static Date` | `readTimeInstantAsDate(String aDateTime)` Parse the date time back into a Date.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### XMLDateTimeUtil

    public XMLDateTimeUtil()

  Default constructor.

Method Detail

### formatDate

    public static String formatDate(Calendar aDate)

### formatDate

    public static String formatDate(Date aDate)

  Format a date in ISO standard.

  Parameters:
    `aDate` -
  Returns:
    correctly formatted string.

### formatTime

    public static String formatTime(Calendar aTime)

### formatTime

    public static String formatTime(Date aTime)

  Format a time in ISO standard.

  Parameters:
    `aTime` -
  Returns:
    correctly formatted string.

### formatTimeInstant

    public static String formatTimeInstant(Calendar aDateTime)

### formatTimeInstant

    public static String formatTimeInstant(Date aDateTime)

  Format a date-time in ISO standard.

  Parameters:
    `aDateTime` -
  Returns:
    correctly formatted string.

### getOffset

    public static String getOffset(Calendar calendar)

  Create a string representing the offset for the date being formatted. The reason this needs to be called when the date is created, rather than set in a static manner, is that when someone creates a date for a time of year with a different savings/standard time than the current time, the offset needs to be correct. So this method returns the correct offset for the date being created.

### jdk14CompliantString

    protected static StringBuffer jdk14CompliantString(StringBuffer sb)

  The dates we use are ISO8601 compliant, but jdk does not understand that, so we return a string buffer that understand jdk1.4 format. Essentially what it does is that it removes the ':' in the timezone

### main

    public static void main(String[] args)

### readDate

    public static Calendar readDate(String aDate)

### readDateAsDate

    public static Date readDateAsDate(String aDate)

  Parse the xml string back into a Date.

### readTime

    public static Calendar readTime(String aTime)

### readTimeAsDate

    public static Date readTimeAsDate(String aTime)

  Parse the time back into a Date. This method uses the current date as the date to accompany the time string, so that the Date object returned will have the correct standard-vs-savings time offset. If you just format a time string with no date, you get that time on 1 January 1970, which will cause the time offset to be wrong during daylight-savings time.

### readTimeInstant

    public static Calendar readTimeInstant(String aDateTime)

### readTimeInstantAsDate

    public static Date readTimeInstantAsDate(String aDateTime)

  Parse the date time back into a Date.

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2005 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 BEA Systems, Inc. All Rights Reserved