Skip to content

Latest commit

 

History

History
128 lines (124 loc) · 3.61 KB

ISO_8601.md

File metadata and controls

128 lines (124 loc) · 3.61 KB

ISO Date Time Standards

Below are the basics of the ISO 8601 Date / Time specification

Dates

Calendar date ✅

  1. Complete Representations
  • Basic: YYYYMMDD
  • Extended: YYYY-MM-DD
  1. Reduced Accuracy
  • Specific Month
    • Basic: YYYY-MM
  • Specific Year
    • Basic: YYYY
  • Specific Century
    • Basic: YY

Ordinal Date

  1. Complete Representations
  • Basic: YYYYDDD
  • Extended: YYYY-DD

Week Date

  1. Complete Representation
  • Basic: YYYYWwwD
  • Extended: YYYY-Www-D
  1. Reduced Accuracy
  • Basic: YYYYWww
  • Extended: YYYY-Www

Time of Day

Local Time

  1. Complete Representations
  • Basic: hhmmss
  • Extended: hh:mm:ss
  1. Reduced Accuracy
  • Specific Minute
    • Basic: hhmm
    • Extended: hh:mm
  • Specific Hour
    • Basic: hh
  1. Decimal Fractions
  • A minimum of 1 digit after the decimal point, up to as many as needed.
  • Fraction of Second
    • Basic: hhmmss,ss or hhmmss.ss
    • Extended: hh:mm:ss,ss or hh:mm:ss.ss
  • Fraction of Minute
    • Basic: hhmm,ss or hhmm.mm
    • Extended: hh:mm,mm or hh:mm.mm
  • Fraction of hour
    • Basic: hh,hh or hh.hh

Time designator

  • Any local time may be preceded bt the time designator: T
  • If the context is ambiguous, the time must be preceeded by T

Beginning / End of Day

  1. Beginning
  • Basic: 000000
  • Extended: 00:00:00
  1. End
  • Basic: 240000
  • Extended: 24:00:00

UTC of day

  1. Basic
  • hhmmssZ
  • hhmmZ
  • hhZ
  1. Extended
  • hh:mm:ssZ
  • hh:mmZ

Difference between UTC and local

  1. Basic
  • hhmmss+hhmm or hhmmss-hhmm
  • hhmmss+hh or hhmmss-hh
  1. Extended
  • hh:mm:ss+hh:mm or hh:mm:ss-hh:mm
  • hh:mm:ss+hh or hh:mm:ss-hh

Date and Time

Complete Representations

  1. Basic
  • YYYYMMDDThhmmss
  • YYYYMMDDThhmmssZ
  • YYYYMMDDThhmmss±hhmm
  • YYYYMMDDThhmmss±hh
  1. Extended
  • YYYY-MM-DDThh:mm:ss
  • YYYY-MM-DDThh:mm:ssZ
  • YYYY-MM-DDThh:mm:ss±hh:mm
  • YYYY-MM-DDThh:mm:ss±hh

Non-Complete Representations

Combinations of date ant time formats defined above

  • rules above are applied ✅
  • does not qualify as a complete date and time ✅
  • the date does not have reduced accuracy
  • completely in basic, or completely in extended format Examples:
  1. Calendar date and local time
  • Basic: YYYYMMDDThhmm
  • Extended: YYYY-MM-DDThh:mm
  1. Ordinal date and UTC of day
  • Basic: YYYYDDDThhmmZ
  • Extended: YYYY-DDDThh:mmZ
  1. Week date and local time and the difference from UTC
  • Basic: YYYYWwwDThhmm±hhmm
  • Extended: YYYY-Www-DThh:mm±hh

Time Interval

  1. A start and an end - Basic: YYYYMMDDThhmmss/YYYYMMDDThhmmss - Extended: YYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss
  2. A duration and context info (only duration provided by ISO str) - Basic/Extended:
    • PnnYnnMnnDTnnHnnMnnS
    • PnnW - Alternate:
    • Basic: PYYYYMMDDThhmmss
    • Extended: PYYYY-MM-DDThh:mm:ss
  3. A start and a duration - Basic:
    • YYYYMMDDThhmmss/PnnYnnMnnDTnnHnnMnnS
    • YYYYMMDDThhmmss/PYYYYMMDDThhmmss - Extended:
    • YYYY-MM-DDThh:mm:ss/PnnYnnMnnDTnnHnnMnnS
    • YYYY-MM-DDThh:mm:ss/PYYYY-MM-DDThh:mm:ss
  4. A duration and an end - Basic:
    • PnnYnnMnnDTnnHnnMnnS/YYYYMMDDThhmmss
    • PYYYYMMDDThhmmss/YYYYMMDDThhmmss - Extended:
    • PnnYnnMnnDTnnHnnMnnS/YYYY-MM-DDThh:mm:ss
    • PYYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss