org.alfresco.util
Class ISO8601DateFormat

java.lang.Object
  extended by org.alfresco.util.ISO8601DateFormat

public class ISO8601DateFormat
extends java.lang.Object

Formatting support for ISO 8601 dates

    sYYYY-MM-DDThh:mm:ss.sssTZD
 
where:


Constructor Summary
ISO8601DateFormat()
           
 
Method Summary
static java.lang.String format(java.util.Date isoDate)
          Format date into ISO format
static java.util.Date parse(java.lang.String isoDate)
          Parse date from ISO formatted string.
static java.util.Date parse(java.lang.String isoDate, java.util.TimeZone timezone)
          Parse date from ISO formatted string, with an explicit timezone specified
static java.util.Date parseInternal(java.lang.String isoDate, java.util.TimeZone timezone)
          Parse date from ISO formatted string, either in the specified TimeZone, or with TimeZone information taken from the date
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ISO8601DateFormat

public ISO8601DateFormat()
Method Detail

format

public static java.lang.String format(java.util.Date isoDate)
Format date into ISO format

Parameters:
isoDate - the date to format
Returns:
the ISO formatted string

parse

public static java.util.Date parse(java.lang.String isoDate)
Parse date from ISO formatted string. The ISO8601 date must include TimeZone offset information

Parameters:
isoDate - ISO string to parse
Returns:
the date
Throws:
AlfrescoRuntimeException - if the parse failed

parse

public static java.util.Date parse(java.lang.String isoDate,
                                   java.util.TimeZone timezone)
Parse date from ISO formatted string, with an explicit timezone specified

Parameters:
isoDate - ISO string to parse
timezone - The TimeZone the date is in
Returns:
the date
Throws:
AlfrescoRuntimeException - if the parse failed

parseInternal

public static java.util.Date parseInternal(java.lang.String isoDate,
                                           java.util.TimeZone timezone)
Parse date from ISO formatted string, either in the specified TimeZone, or with TimeZone information taken from the date

Parameters:
isoDate - ISO string to parse
Returns:
the date
Throws:
AlfrescoRuntimeException - if the parse failed


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.