discord-api-docs
discord-api-docs copied to clipboard
Documentation doesn't mention the required precision of timestamps used in message formatting
Description
The Message Formatting part of the documentation (https://discord.com/developers/docs/reference#message-formatting) mentions unix timestamps but doesn't specify that the parser expects timestamps with second precision. Using millisecond timestamps will result in formatted dates beyond the year 50000 and microsecond timestamps will outright cause NaNs and undefineds to appear in formatted output.
Steps to Reproduce
<t:1656090207>
<t:1656090207000>
<t:1656090207000000>
Expected Behavior
I'd expect usage of timestamps that can't be parsed to result in an error message, not mangled output. Better yet, timestamps exceeding a certain size should automatically be parsed as timestamps with increased precision, up to some sensible limit.
And please amend the documentation to mention the expected timestamp precision. The only mention of precision in a timestamp context is in the Snowflake ID section and there, milliseconds are being mentioned: https://discord.com/developers/docs/reference#snowflakes-snowflake-id-format-structure-left-to-right
Current Behavior
See attached screenshot.
Screenshots/Videos
Client and System Information
This is a problem on Discord's end, not mine.
Closed thanks to AlmostSuspense