org.springframework.extensions.surf.util
Class ISO8601DateFormat
java.lang.Object
org.springframework.extensions.surf.util.ISO8601DateFormat
public class ISO8601DateFormat
- extends Object
Formatting support for ISO 8601 dates
sYYYY-MM-DDThh:mm:ss.sssTZD
where:
- sYYYY Four-digit year with optional leading positive (+) or negative (-) sign.
A negative sign indicates a year BCE. The absence of a sign or the presence of a
positive sign indicates a year CE (for example, -0055 would indicate the year 55 BCE,
while +1969 and 1969 indicate the year 1969 CE).
- MM Two-digit month (01 = January, etc.)
- DD Two-digit day of month (01 through 31)
- hh Two digits of hour (00 through 23)
- mm Two digits of minute (00 through 59)
- ss.sss Seconds, to three decimal places (00.000 through 59.999)
- TZD Time zone designator (either Z for Zulu, i.e. UTC, or +hh:mm or -hh:mm, i.e. an offset from UTC)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ISO8601DateFormat
public ISO8601DateFormat()
format
public static String format(Date isoDate)
- Format date into ISO format
- Parameters:
isoDate
- the date to format
- Returns:
- the ISO formatted string
parse
public static Date parse(String isoDate)
- Parse date from ISO formatted string
- Parameters:
isoDate
- ISO string to parse
- Returns:
- the date
- Throws:
PlatformRuntimeException
- if the parse failed
Copyright © 2009 SpringSource, Inc. All Rights Reserved.