marnusw / date-fns-tz

Complementary library for date-fns v2 adding IANA time zone support
MIT License
1.06k stars 116 forks source link

RangeError: Invalid time zone specified: "UTC" #244

Closed tiemibf closed 1 year ago

tiemibf commented 1 year ago

hey, there! I've been trying to use formatInTimeZone() to convert time to user's timezone and setting 'GMT' as default, in case the user doesn't set a preference, but I'm getting RangeError: Invalid time zone specified: UTC. Already tried "GMT", "Etc/GMT", "Etc/UTC". Also tried some other IANA timezones and couldn't find one that wouldn't throw this same error still.

return formatInTimeZone(date, timezoneString || 'UTC', 'iii, MMM dd, yyyy, h:mm:ss a O');

Using date-fns-tz@^2.0.0.

adyrmishi commented 3 months ago

Hi! Just wondering if you fixed the problem you were having with this? :) @tiemibf