Open ChristopherMayes opened 4 years ago
Good catch, I was thinking the same thing last week when someone posted about ISO 8601.
Out of the extended formats in ISO 8601, should we go for
Complete date plus hours, minutes and seconds:
YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
or
Complete date plus hours, minutes, seconds and a decimal fraction of a
second
YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)
Looks like the decimal fraction of a second can be arbitrarily long, which is good.
I usually use datetime
builtin Python package to deal with these strings:
datetime.fromisoformat('1997-07-16T19:20:30+01:00')
But @ax3l your second string is not valid.
The base standard has:
date
2015-12-02 17:48:42 +0100
But there is a good standard for this: https://en.wikipedia.org/wiki/ISO_8601
I suggest that ISO 8601 is the standard for the
date
string, e.g.2020-05-13T19:41:34-07:00