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,ssorhhmmss.ss✅ - Extended:
hh:mm:ss,ssorhh:mm:ss.ss✅
- Basic:
- Fraction of Minute
- Basic:
hhmm,ssorhhmm.mm✅ - Extended:
hh:mm,mmorhh:mm.mm✅
- Basic:
- Fraction of hour
- Basic:
hh,hhorhh.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+hhmmorhhmmss-hhmm✅hhmmss+hhorhhmmss-hh✅
- Extended
hh:mm:ss+hh:mmorhh:mm:ss-hh:mm✅hh:mm:ss+hhorhh: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:
PnnYnnMnnDTnnHnnMnnSPnnW- Alternate:- Basic:
PYYYYMMDDThhmmss - Extended:
PYYYY-MM-DDThh:mm:ss
- A start and a duration
- Basic:
YYYYMMDDThhmmss/PnnYnnMnnDTnnHnnMnnSYYYYMMDDThhmmss/PYYYYMMDDThhmmss- Extended:YYYY-MM-DDThh:mm:ss/PnnYnnMnnDTnnHnnMnnSYYYY-MM-DDThh:mm:ss/PYYYY-MM-DDThh:mm:ss
- A duration and an end
- Basic:
PnnYnnMnnDTnnHnnMnnS/YYYYMMDDThhmmssPYYYYMMDDThhmmss/YYYYMMDDThhmmss- Extended:PnnYnnMnnDTnnHnnMnnS/YYYY-MM-DDThh:mm:ssPYYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss