Timestamp: support date time strings instead of just UNIX timestamps
Description
Currently, the localized timestamp feature only supports UNIX timestamps. This is an extremely useful feature 🤩, but at the moment its usefulness is limited by poor UX 😵.
As a discord user, I should not need to know what a UNIX timestamp is nor need to rely on a 3rd party website to generate one for me in order to use this feature. I should be able to input a datetime string with timezone specification.
The following suggested implementation should take care of both of these issues:
Current implementation
- User must navigate to a 3rd party website and generate a UNIX timestamp
- User must remember that the timestamp generated, if not using a 3rd party website that supports timezone specification for UNIX timestamps, will be relative to their timezone and thus needs to factor in an offset in their timestamp
Proposed implementation
- User inputs `<t:3/15/23 11:30 PM EST>`
JavaScript natively supports parsing of date time strings using its `Date` constructor already, so minimal logic would be needed. Yes, the user would still need to input the date time string in a syntax that JS can parse, but this method allows the user to input an intuitive, user-friendly string with minimal prior knowledge (aside from knowing the syntax of the timestamps - I'm suggesting to keep the <t:> syntax for now as a compromise to limit the amount of development work needed) and the ability to specify a timezone.
Войдите в службу, чтобы оставить комментарий.
Комментарии
0 комментариев