Ahmed FASIH is a user on octodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

Bit concerned that ISO dates have only four-digit years. Should I manually prepend two or three zeros to my ISO timestamps?

To clarify, I’m using one of these NoSQL databases whose idea of sorting is limited to lexicographic sort (i.e., stringy sort: leveldb, CouchDB). I use ISO-formatted timestamps—“2017-07-03T17:48:12.857Z”—as part of the stringy key to get temporal sorting, but naturally this will break in the year 10k of the Common Era, since `10000-01-01T…` sorts before `9999-12-12T…` (or `2017-07-03T…` for that matter).

Lexicographic sorting, ladies and gents…

Ahmed FASIH @22

Thanks to @dasyatidprime’s pointer to tools.ietf.org/html/rfc2550 (section 3) the solution has already been described. Year 10K will be stringified as A10000. Year 100K as "B100000". And so on.

Problem solved. Moving on. Nothing more left to see.

· Web · 1 · 0

@22 Now you just have to make sure someone actually implements that in the relevant software within the next few thousand years, and you're good. :-) (I'm leaving an additional several thousand years for proper deployment and integration testing, of course…)