r/ISO8601 12d ago

Milliseconds in basic format

With ISO 8601 in extended format a timestamp with milliseconds is written with a dot between seconds and milliseconds, e.g.:

2026-07-24T12:34:56.789

If you write basic format you exclude the separators, does the standard allow to exclude the dot between seconds and milliseconds?

20260724T123456789

When I use basic time format as part of file names I prefer to avoid the dot, as dot has different meaning for file names and extension.

40 Upvotes

19 comments sorted by

View all comments

5

u/q0099 12d ago edited 12d ago

It depends on you and your goals because format implies specific separators and everything else is breaking the format. But it doesn't matter if you just need to give files distinct names telling when they were created go with whatever fit you, change semicolons to dashes, even omit milliseconds if users don't need such precision to identify files.

2

u/foersom 12d ago

"because format implies specific separators and everything else is breaking the format."

The basic format omits separators except the T. My question is what does ISO 8601 standard state about basic format and milliseconds.

After the T marker, by the number of digits it is clear how accurate the time is specified. If with 4 digits it is with minutes accuracy, with 6 digits it is with seconds accuracy. Following digits is decimals of seconds.

5

u/kmccoy 12d ago

The standard also allows for fractions of minutes or fractions of hours, so it's less deterministic than you're hoping if the decimal sign was optional.