mastodon / documentation

Mastodon documentation
https://docs.joinmastodon.org
GNU Free Documentation License v1.3
1.7k stars 973 forks source link

Documentation: DateTime fields, fix ISO 8601 type #1241

Open msmuenchen opened 1 year ago

msmuenchen commented 1 year ago

All documentation (e.g. entities/Account.md) state that DateTime fields are in ISO 8601 format.

This however is a bit misleading, given that at least Java and PHP specify "ISO" as a format in which the second has no fraction and thus leads to parsing errors if a programmer naively selects the predefined ISO 8601 format string. Besides, the ISO 8601 standard is not publicly available.

Therefore I suggest to replace all mentions of "ISO 8601" by "RFC 3339 (with fractional seconds)".

ItIsOHM commented 1 year ago

Hey there, I'd like to work on this issue as a beginner. Can you please guide me a little if my approach is correct? From what I can understand, I just need to find all the text ISO 8601 and just replace it with RFC 3339 (with fractional seconds)?

nightpool commented 1 year ago

The wikipedia article for ISO 8601 states "If necessary for a particular application, the standard supports the addition of a decimal fraction to the smallest time value in the representation.". I'm not sure that we should make such a wide-ranging change just because some languages have a buggy implementation.

On Thu, Jul 6, 2023 at 2:15 PM Rhythm Garg @.***> wrote:

Hey there, I'd like to work on this issue as a beginner. Can you please guide me a little if my approach is correct? From what I can understand, I just need to find all the text ISO 8601 and just replace it with RFC 3339 (with fractional seconds)?

— Reply to this email directly, view it on GitHub https://github.com/mastodon/documentation/issues/1241#issuecomment-1624189379, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABZCV6IVL25Q62TN7IAVSDXO4FEFANCNFSM6AAAAAAZ5ADTDU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

msmuenchen commented 1 year ago

Java and PHP are hardly "some" languages... but I did some research, turns out it's complete chaos - moment.js in the JS world is a lenient parser that does accept sub-second precision timestamps, Python relies on whatever an user's strftime implementation in libc supports, .NET accepts down to nanosecond precision - and Google Go doesn't carry a format specifier for ISO 8601 at all but has a lenient parser as well.

Personally I don't care too much, but I think referring to a standard that can be openly read without paying 129€ for a copy would be more appropriate.