How to get list to time zone abbreviations in JavaScript?

56 views Asked by At

I'm writing a date-related logic where the timezone name is important. The user enters the time whatever they want and the timestamp then gets converted to the timezone mentioned internally in a variable. Example - A time entered in IST (GMT +5.30) should be converted to EDT (GMT -5). So far everything is going well. What happened recently is when daylight saving stopped in Eastern time my logic failed as it was taking EST. I tried writing EDT but was getting an error that EDT is not supported. After some research, I found writing EST5EDT fixed my problem of daylight conversion.

Is there any list where I can get the list of abbreviations including the daylight toggling names also?

I found a link for timezones which has the EST5EDT string but I am not able to find any official documentation for the Date API.

0

There are 0 answers