You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 Zoned DateTime to a Utc DateTime.
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.
Summary
In the chat, jessekelly is trying to convert a
DateTime.Zoned
object toDateTime.Utc
within the Effect Typescript library. They express some difficulty in finding a straightforward method for this conversion. whatthebluck suggests usingDateTime.setZone
, but it is not applicable for converting from a zoned time to UTC. jessekelly points out that simply calling.make
on aZoned
object returns anOption<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 extractingepochMillis
from theDateTime.Zoned
and manually constructing aDateTime.Utc
object as a workaround.Key Takeaways:
Zoned
DateTime to aUtc
DateTime.epochMillis
, but acknowledge the need for a more straightforward API for this conversion.Discord thread
https://discord.com/channels/795981131316985866/1334487889160962141
The text was updated successfully, but these errors were encountered: