-
-
Notifications
You must be signed in to change notification settings - Fork 447
Description
Summary
In the chat, jessekelly is trying to convert a DateTime.Zoned object to DateTime.Utc within the Effect Typescript library. They express some difficulty in finding a straightforward method for this conversion. whatthebluck suggests using DateTime.setZone, but it is not applicable for converting from a zoned time to UTC. jessekelly points out that simply calling .make on a Zoned object returns an Option<DateTime.Zoned>, not what they need.
jessedkelly explains that they need the Zoned type on the frontend for parsing user-related time expressions like "today" or "tomorrow" in the user's timezone. rjdellecese suggests extracting epochMillis from the DateTime.Zoned and manually constructing a DateTime.Utc object as a workaround.
Key Takeaways:
- There seems to be a gap in the Effect Typescript library for easily converting a
ZonedDateTime to aUtcDateTime. - Users discussed workarounds, like using
epochMillis, but acknowledge the need for a more straightforward API for this conversion. - This topic is relevant to both participants as they are dealing with user-specific timezone data.
Discord thread
https://discord.com/channels/795981131316985866/1334487889160962141