Alternative to colon in a time format

For combined date and time representations you must use basic format for both date and time or extended format for both date and time representations to comply with ISO 8601.

Examples of ISO 8601 compliant date and time representations:

2020-12-03T15:05:57+00:00 (extended)
2020-12-03T15:05:57Z (extended)
20201203T150557Z (basic)

For maximum compatibility with various operating systems file naming requirements and ISO 8601 compliance I think the last example or something similar should work.

Reference: https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations


There's no other provision and you cannot have a complete datetime expresion with the first half in extended and the last one in basic formats; they must have the same formats.

A workaround, and i emphazise in workaround, is to split the string with something else, e.g., a period or underscore, that separates two valid expresions, the date in extended format and the time in basic format: e.g., myfilename_2020-12-13.T0006Z_otherNotes.ext or myfilename_2020-12-13_T0006Z_otherNotes.ext.

You must be clear with other parts involved in the usage of such files - mainly speaking about machine ones - in that it is not a complete datetime expresion, but 2 valid ones each one in different formats - extended, then basic - separated by an agreed and unambiguous character (i mentioned a period/underscore instead of a dash/hyphen specifically for this reason).

The obvious downsides of this approach are: the time part is harder to read and some other people could believe you badly implemented the ISO or you have poor understanding of it, when not.

The good sides... it works in Windows, it organizes the elements in the filesystem in the right order, despite the OS, it follows the ISO standards (in a special way) and it is compatible with machines (from scripts to AIs and everything in the middle).

It is a workaround. I repeat.

As a final note, i really wonder why the people doing ISO 8601-2019 didn't consider the problem that is using ISO in filenames or if they're totally unaware of it.


There is none.

ISO 8601 only allows for a colon (:) for separating time components in the extended format:

The basic format is [hh][mm][ss] and the extended format is [hh]:[mm]:[ss].

There is no provision for an alternate extended format.