Jc3s5h added a comment. As for
> The +0019 example is irrelevant for what we do. It is somewhat relevant because the data consumer may be using a pre-written ISO 8601 parser that supports +0019 as a century for year length 6, and must know the year length in order to do so. If we emit data that can't be read by a standard-compliant parser we are non-compliant. It seems abundantly clear we will not accept every possible ISO 8601 input. We should create a formal profile of ISO 8601 showing what we will accept. Our profile could be more relaxed on input, but not on output. As for not making guarantees, if we violate our own documentation, the message to data consumers is we will emit something that vaguely resembles a date, you figure it out on a case-by-case basis. In other words, the only way to read a date is human inspection. In https://phabricator.wikimedia.org/T66084#997983, @thiemowmde wrote: > The +0019 example is irrelevant for what we do. > > Code that does `string.sub(d, 9, 18)` is just wrong, no matter how you look > at it, and can't be of any relevance for what we do. Think about it. What > does it do if it processes the value `-00000042000-01-01T00:00:00Z`. It > extracts "2000-01-01". Fail. > > Writing a proper parser is as trivial as it can be: > `/^[-+](\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)/`. We guarantee there will always > be a sign character, we guarantee there will always be separation characters > (`-`, `T` and `:`). We do **not** guarantee the time zone "Z" will always be > there. We may support different time zones in the future. And we do **not** > guarantee the year will always have the same fixed number of digits. We > currently try to pad everything to 16 digits but we **can't** guarantee. This > is not how Wikibase works. TASK DETAIL https://phabricator.wikimedia.org/T66084 REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>. EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Jc3s5h Cc: thiemowmde, Jc3s5h, Wikidata-bugs, Nemo_bis, Addshore, MZMcBride, Lydia_Pintscher, JohnLewis, aude _______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
