|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.commons.utils.ISO8601
public class ISO8601
Created by The eXo Platform SAS Author : Peter Nedonosko peter.nedonosko@exoplatform.com.ua 05.07.2007 ISO 8601 standard Year: YYYY (eg 1997) Year and month: YYYY-MM (eg 1997-07) Complete date: YYYY-MM-DD (eg 1997-07-16) Complete date plus hours and minutes: YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00) Complete date plus hours, minutes and seconds: YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00) Complete date plus hours, minutes, seconds and a decimal fraction of a second YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00) where: YYYY = four-digit year MM = two-digit month (01=January, etc.) DD = two-digit day of month (01 through 31) hh = two digits of hour (00 through 23) (am/pm NOT allowed) mm = two digits of minute (00 through 59) ss = two digits of second (00 through 59) s = one or more digits representing a decimal fraction of a second TZD = time zone designator (Z or +hh:mm or -hh:mm) a RFC 822 time zone is also accepted: For formatting, the RFC 822 4-digit time zone format is used: RFC822TimeZone: Sign TwoDigitHours Minutes TwoDigitHours: Digit Digit like -8000
| Nested Class Summary | |
|---|---|
protected static class |
ISO8601.ISODateFormat
|
| Field Summary | |
|---|---|
static java.lang.String |
COMPLETE_DATE_FORMAT
Complete date: YYYY-MM-DD (eg 1997-07-16) |
static java.lang.String |
COMPLETE_DATEHOURSMINUTESZ_FORMAT
Complete date plus hours and minutes: YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00) |
static java.lang.String |
COMPLETE_DATEHOURSMINUTESZRFC822_FORMAT
NON ISO STANDARD. |
static java.lang.String |
COMPLETE_DATETIMEMSZ_FORMAT
Complete date plus hours, minutes, seconds and a decimal fraction of a second YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00) |
static java.lang.String |
COMPLETE_DATETIMEMSZRFC822_FORMAT
Complete date plus hours, minutes, seconds and a decimal fraction of a second, with timezone by RFC822 YYYY-MM-DDThh:mm:ss.sZ (eg 1997-07-16T19:20:30.45+0100) |
static java.lang.String |
COMPLETE_DATETIMEZ_FORMAT
Complete date plus hours, minutes and seconds: YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00) |
static java.lang.String |
COMPLETE_DATETIMEZRFC822_FORMAT
NON ISO STANDARD. |
static java.lang.String[] |
FORMATS
Possible formats list. |
static java.lang.String |
SIMPLE_DATEHOURSMINUTES_FORMAT
NON ISO STANDARD. |
static java.lang.String |
SIMPLE_DATETIME_FORMAT
NON ISO STANDARD. |
static java.lang.String |
SIMPLE_DATETIMEMS_FORMAT
NON ISO STANDARD. |
protected static java.lang.String |
TZD
ISO 8601 time zone designator |
static java.lang.String |
YEAR_FORMAT
Year: YYYY (eg 1997) |
static java.lang.String |
YEARMONTH_FORMAT
Year and month: YYYY-MM (eg 1997-07) |
| Constructor Summary | |
|---|---|
ISO8601()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
format(java.util.Calendar date)
Format date using format: complete date plus hours, minutes, seconds and a decimal fraction of a second. |
static java.util.Calendar |
parse(java.lang.String dateString)
Parse string using possible formats list. |
static java.util.Calendar |
parse(java.lang.String dateString,
java.lang.String[] formats)
Parse string using given formats list. |
static java.util.Calendar |
parseEx(java.lang.String dateString)
Parse string using possible formats list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String TZD
public static final java.lang.String YEAR_FORMAT
public static final java.lang.String YEARMONTH_FORMAT
public static final java.lang.String COMPLETE_DATE_FORMAT
public static final java.lang.String SIMPLE_DATEHOURSMINUTES_FORMAT
public static final java.lang.String COMPLETE_DATEHOURSMINUTESZRFC822_FORMAT
public static final java.lang.String COMPLETE_DATEHOURSMINUTESZ_FORMAT
public static final java.lang.String SIMPLE_DATETIME_FORMAT
public static final java.lang.String COMPLETE_DATETIMEZRFC822_FORMAT
public static final java.lang.String COMPLETE_DATETIMEZ_FORMAT
public static final java.lang.String SIMPLE_DATETIMEMS_FORMAT
public static final java.lang.String COMPLETE_DATETIMEMSZRFC822_FORMAT
public static final java.lang.String COMPLETE_DATETIMEMSZ_FORMAT
public static final java.lang.String[] FORMATS
| Constructor Detail |
|---|
public ISO8601()
| Method Detail |
|---|
public static java.lang.String format(java.util.Calendar date)
date -
public static java.util.Calendar parse(java.lang.String dateString)
dateString - - date string
public static java.util.Calendar parseEx(java.lang.String dateString)
throws java.text.ParseException,
java.lang.NumberFormatException
dateString - - date string
ParseException, - NumberFormatException
java.text.ParseException
java.lang.NumberFormatException
public static java.util.Calendar parse(java.lang.String dateString,
java.lang.String[] formats)
throws java.text.ParseException
dateString - formats -
java.text.ParseException
java.lang.NumberFormatException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||