Class ISO8601

java.lang.Object
org.exoplatform.commons.utils.ISO8601

public class ISO8601 extends Object
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
  • Field Details

    • TZD

      protected static final String TZD
      ISO 8601 time zone designator
      See Also:
    • YEAR_FORMAT

      public static final String YEAR_FORMAT
      Year: YYYY (eg 1997)
      See Also:
    • YEARMONTH_FORMAT

      public static final String YEARMONTH_FORMAT
      Year and month: YYYY-MM (eg 1997-07)
      See Also:
    • COMPLETE_DATE_FORMAT

      public static final String COMPLETE_DATE_FORMAT
      Complete date: YYYY-MM-DD (eg 1997-07-16)
      See Also:
    • SIMPLE_DATEHOURSMINUTES_FORMAT

      public static final String SIMPLE_DATEHOURSMINUTES_FORMAT
      NON ISO STANDARD. Simple date plus hours and minutes, without time zone: YYYY-MM-DDThh:mm (eg 1997-07-16T19:20)
      See Also:
    • COMPLETE_DATEHOURSMINUTESZRFC822_FORMAT

      public static final String COMPLETE_DATEHOURSMINUTESZRFC822_FORMAT
      NON ISO STANDARD. Complete date plus hours and minutes, with time zone by RFC822: YYYY-MM-DDThh:mmZ (eg 1997-07-16T19:20+0100)
      See Also:
    • COMPLETE_DATEHOURSMINUTESZ_FORMAT

      public static final String COMPLETE_DATEHOURSMINUTESZ_FORMAT
      Complete date plus hours and minutes: YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
      See Also:
    • SIMPLE_DATETIME_FORMAT

      public static final String SIMPLE_DATETIME_FORMAT
      NON ISO STANDARD. Simple date plus hours, minutes and seconds, without time zone: YYYY-MM-DDThh:mm:ss (eg 1997-07-16T19:20:30)
      See Also:
    • COMPLETE_DATETIMEZRFC822_FORMAT

      public static final String COMPLETE_DATETIMEZRFC822_FORMAT
      NON ISO STANDARD. Complete date plus hours, minutes and seconds, with time zone by RFC822: YYYY-MM-DDThh:mm:ssZ (eg 1997-07-16T19:20:30+0100)
      See Also:
    • COMPLETE_DATETIMEZ_FORMAT

      public static final String COMPLETE_DATETIMEZ_FORMAT
      Complete date plus hours, minutes and seconds: YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
      See Also:
    • SIMPLE_DATETIMEMS_FORMAT_1

      public static final String SIMPLE_DATETIMEMS_FORMAT_1
      NON ISO STANDARD. Simple date plus hours, minutes, seconds and a decimal fraction of a second, without time zone YYYY-MM-DDThh:mm:ss.s (eg 1997-07-16T19:20:30.45)
      See Also:
    • SIMPLE_DATETIMEMS_FORMAT

      public static final String SIMPLE_DATETIMEMS_FORMAT
      NON ISO STANDARD. Simple date plus hours, minutes, seconds and a decimal fraction of a second, without time zone YYYY-MM-DDThh:mm:ss.s (eg 1997-07-16T19:20:30.450)
      See Also:
    • COMPLETE_DATETIMEMSZRFC822_FORMAT_1

      public static final String COMPLETE_DATETIMEMSZRFC822_FORMAT_1
      Complete date plus hours, minutes, seconds and a decimal fraction of a second, with time zone by RFC822 YYYY-MM-DDThh:mm:ss.sZ (eg 1997-07-16T19:20:30.45+0100)
      See Also:
    • COMPLETE_DATETIMEMSZRFC822_FORMAT

      public static final String COMPLETE_DATETIMEMSZRFC822_FORMAT
      Complete date plus hours, minutes, seconds and a decimal fraction of a second, with time zone by RFC822 YYYY-MM-DDThh:mm:ss.sZ (eg 1997-07-16T19:20:30.450+0100)
      See Also:
    • COMPLETE_DATETIMEMSZ_FORMAT

      public static final 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.450+01:00)
      See Also:
    • COMPLETE_DATETIMEMSZ_FORMAT_1

      public static final String COMPLETE_DATETIMEMSZ_FORMAT_1
      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)
      See Also:
    • FORMATS

      public static final String[] FORMATS
      Possible formats list. ISO 8601, RFC822 + simple formats in order of priority of parse
    • LEGACY_FORMATS

      public static final String[] LEGACY_FORMATS
  • Constructor Details

    • ISO8601

      public ISO8601()
  • Method Details