Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a TZDate instance from an IsoString with offset #41

Open
gbalduzzi opened this issue Jan 16, 2025 · 0 comments
Open

Create a TZDate instance from an IsoString with offset #41

gbalduzzi opened this issue Jan 16, 2025 · 0 comments

Comments

@gbalduzzi
Copy link

From an external service, I receive time strings in the iso format, containing the timezone offset:

2024-09-12T00:00:00Z+02:00
2024-09-12T00:00:00Z-05:00

date-fns parseIso correctly process the timezone, but converts the Date into the browser timezone.

Is there a way to obtain a proper TZDate instance from such an isoString?

In the documentation I can only see ways to build a TZDate when you already know the desidered timezone in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant