Below are the basics of the ISO 8601 Date / Time specification
- Complete Representations
- Basic:
YYYYMMDD
✅ - Extended:
YYYY-MM-DD
✅
- Reduced Accuracy
- Specific Month
- Basic:
YYYY-MM
✅
- Basic:
- Specific Year
- Basic:
YYYY
✅
- Basic:
- Specific Century
- Basic:
YY
✅
- Basic:
- Complete Representations
- Basic:
YYYYDDD
✅ - Extended:
YYYY-DD
✅
- Complete Representation
- Basic:
YYYYWwwD
✅ - Extended:
YYYY-Www-D
✅
- Reduced Accuracy
- Basic:
YYYYWww
✅ - Extended:
YYYY-Www
✅
- Complete Representations
- Basic:
hhmmss
✅ - Extended:
hh:mm:ss
✅
- Reduced Accuracy
- Specific Minute
- Basic:
hhmm
✅ - Extended:
hh:mm
✅
- Basic:
- Specific Hour
- Basic:
hh
✅
- Basic:
- Decimal Fractions
- A minimum of 1 digit after the decimal point, up to as many as needed.
- Fraction of Second
- Basic:
hhmmss,ss
orhhmmss.ss
✅ - Extended:
hh:mm:ss,ss
orhh:mm:ss.ss
✅
- Basic:
- Fraction of Minute
- Basic:
hhmm,ss
orhhmm.mm
✅ - Extended:
hh:mm,mm
orhh:mm.mm
✅
- Basic:
- Fraction of hour
- Basic:
hh,hh
orhh.hh
✅
- Basic:
- Any local time may be preceded bt the time designator:
T
✅ - If the context is ambiguous, the time must be preceeded by
T
✅
- Beginning
- Basic:
000000
✅ - Extended:
00:00:00
✅
- End
- Basic:
240000
✅ - Extended:
24:00:00
✅
- Basic
hhmmssZ
✅hhmmZ
✅hhZ
✅
- Extended
hh:mm:ssZ
✅hh:mmZ
✅
- Basic
hhmmss+hhmm
orhhmmss-hhmm
✅hhmmss+hh
orhhmmss-hh
✅
- Extended
hh:mm:ss+hh:mm
orhh:mm:ss-hh:mm
✅hh:mm:ss+hh
orhh:mm:ss-hh
✅
- Basic
YYYYMMDDThhmmss
✅YYYYMMDDThhmmssZ
✅YYYYMMDDThhmmss±hhmm
✅YYYYMMDDThhmmss±hh
✅
- Extended
YYYY-MM-DDThh:mm:ss
✅YYYY-MM-DDThh:mm:ssZ
✅YYYY-MM-DDThh:mm:ss±hh:mm
✅YYYY-MM-DDThh:mm:ss±hh
✅
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:
- Calendar date and local time
- Basic:
YYYYMMDDThhmm
✅ - Extended:
YYYY-MM-DDThh:mm
✅
- Ordinal date and UTC of day
- Basic:
YYYYDDDThhmmZ
✅ - Extended:
YYYY-DDDThh:mmZ
✅
- Week date and local time and the difference from UTC
- Basic:
YYYYWwwDThhmm±hhmm
✅ - Extended:
YYYY-Www-DThh:mm±hh
✅
- A start and an end
- Basic:
YYYYMMDDThhmmss/YYYYMMDDThhmmss
- Extended:YYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss
- A duration and context info (only duration provided by ISO str)
- Basic/Extended:
PnnYnnMnnDTnnHnnMnnS
PnnW
- Alternate:- Basic:
PYYYYMMDDThhmmss
- Extended:
PYYYY-MM-DDThh:mm:ss
- 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
- 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