discord.js time() helper cannot enforce a specific timezone
0 reputation · 30 May 2023, 07:31 UTC
Goal
Use discord.js Util.time() to display a scheduled event time consistently across all viewers, independent of each client’s local time zone.
Constraints
The helper, available since discord.js v13.6.0, accepts a JavaScript Date or epoch number and an optional style such as 'short', 'long', or 'relative'. It returns a Discord Markdown timestamp that the receiving client renders in the viewer’s local time zone. No parameter exists to supply or force a specific offset, and non-UTC Date objects are converted to UTC before formatting. Relative styles also resolve against the client’s clock rather than the server’s.
Open question
Is there a supported method to pin a timestamp to one fixed time zone, or should developers bypass time() and send formatted plain text when a single reference time is required?