|
eXo Kernel :: Commons Utils 2.4.13-GA | |||||||||
| 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 String |
COMPLETE_DATE_FORMAT
Complete date: YYYY-MM-DD (eg 1997-07-16) |
static String |
COMPLETE_DATEHOURSMINUTESZ_FORMAT
Complete date plus hours and minutes: YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00) |
static String |
COMPLETE_DATEHOURSMINUTESZRFC822_FORMAT
NON ISO STANDARD. |
static 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 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 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 String |
COMPLETE_DATETIMEZRFC822_FORMAT
NON ISO STANDARD. |
static String[] |
FORMATS
Possible formats list. |
static String |
SIMPLE_DATEHOURSMINUTES_FORMAT
NON ISO STANDARD. |
static String |
SIMPLE_DATETIME_FORMAT
NON ISO STANDARD. |
static String |
SIMPLE_DATETIMEMS_FORMAT
NON ISO STANDARD. |
protected static String |
TZD
ISO 8601 time zone designator |
static String |
YEAR_FORMAT
Year: YYYY (eg 1997) |
static String |
YEARMONTH_FORMAT
Year and month: YYYY-MM (eg 1997-07) |
| Constructor Summary | |
|---|---|
ISO8601()
|
|
| Method Summary | |
|---|---|
static String |
format(Calendar date)
Format date using format: complete date plus hours, minutes, seconds and a decimal fraction of a second. |
static Calendar |
parse(String dateString)
Parse string using possible formats list. |
static Calendar |
parse(String dateString,
String[] formats)
Parse string using given formats list. |
static Calendar |
parseEx(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 String TZD
public static final String YEAR_FORMAT
public static final String YEARMONTH_FORMAT
public static final String COMPLETE_DATE_FORMAT
public static final String SIMPLE_DATEHOURSMINUTES_FORMAT
public static final String COMPLETE_DATEHOURSMINUTESZRFC822_FORMAT
public static final String COMPLETE_DATEHOURSMINUTESZ_FORMAT
public static final String SIMPLE_DATETIME_FORMAT
public static final String COMPLETE_DATETIMEZRFC822_FORMAT
public static final String COMPLETE_DATETIMEZ_FORMAT
public static final String SIMPLE_DATETIMEMS_FORMAT
public static final String COMPLETE_DATETIMEMSZRFC822_FORMAT
public static final String COMPLETE_DATETIMEMSZ_FORMAT
public static final String[] FORMATS
| Constructor Detail |
|---|
public ISO8601()
| Method Detail |
|---|
public static String format(Calendar date)
date -
public static Calendar parse(String dateString)
dateString - - date string
public static Calendar parseEx(String dateString)
throws ParseException,
NumberFormatException
dateString - - date string
ParseException, - NumberFormatException
ParseException
NumberFormatException
public static Calendar parse(String dateString,
String[] formats)
throws ParseException
dateString - formats -
ParseException
NumberFormatException
|
eXo Kernel :: Commons Utils 2.4.13-GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||