-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
datetimeIn(date, timezone, optionalPrecision) could take a local time and shift it to another timezone.
Use case: “what time is it now in [somewhere far away]?”
How we could make it work:
- Read the UTC values of the provided
Dateobject. - Do something with these values (sorry, should go to bed) and use
Intl.DateTimeFormatto transform the timezone to the specified location, e.g.:
new Intl.DateTimeFormat('en-GB', {
dateStyle: 'short',
timeStyle: 'long',
timeZone: 'America/New_York'
}).format(date); // '03/05/2021, 17:28:22 GMT-4'- Compute timezones difference by comparing the GMT values and/or reparsing the output of 2.
- ??
(Also, check what Moments and others are doing.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request