Changing time according to TimeZone in React with date-fns-tz

Viewed 74

I have a method that gets a parameter as a time string "15:35". That time is in UTC TimeZone. But I wanna convert it to different TimeZone (for example America/New_York or ...).

I installed date-fns-tz package to convert. But I couldn't find easy way to directly converting time with date-fns-tz. Do u have a easy solution with this package.

Example : Given "18:35" in UTC -> Expected 14:35 in America/New_York

NOTE : Please don't recommend moment-timezone package that is deprecated!

0 Answers
Related