babakhani/PersianDate

TimeZone

Closed this issue · 1 comments

Hi there,
How can I set TimeZone?
I want to set timezone to my date then display date with timezone.
For example:
My date is 13 Nov 20:30 in Tehran TimeZone.
I want to show this date in other timezones for England display 13 Nov 17:00

Kind regards.

Probably you've fixed your issue now, anyways I'm writing this for those who read the issue later.
When you want to show time in a different timezone than the browser's timezone, it means you want to show a different time, not the actual time. So you need to convert your time to the new timezone by adding/subtracting the difference.
To do so, you may want to use date-fns-tz and convert your time to the new timezone, then use persianDate.