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

Parse in timezone using format string #242

Open
JRebella opened this issue Jun 23, 2023 · 0 comments
Open

Parse in timezone using format string #242

JRebella opened this issue Jun 23, 2023 · 0 comments

Comments

@JRebella
Copy link

JRebella commented Jun 23, 2023

The base date-fns package lets you parse an incomplete date string using a format and a reference time. For example:

parse('15:00', 'HH:mm', new Date());
// Today at 15:00 in the local browser's timezone

What if I want to do the same but instead of using the local browser's timezone, I want to use a specific IANA timezone name like US/Central?

Similar to day.js's tz parse: https://day.js.org/docs/en/timezone/parsing-in-zone

dayjs.tz("12-25-1995", "MM-DD-YYYY", "America/Toronto")
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