I call an API that returns a time as a string like this : “09:30 a.m. EDT”, “09:00 a.m. CET”, etc. I would like to parse this string to retrieve the timezone from the abbreviation (and also time in 24h format but I don’t have an issue with that part) : “Europe/Paris” from “CET” for example.
I tried this :
moment("09:30 a.m. EDT", 'hh:mm a Z').format('HH:mm Z')
and multiple other things with the extension moment-timezone but it doesn’t seem to recognize abbreviations.
I know that creating a exhaustive mapping table could work but I would prefer something else. Do you have any idea ?
Thanks a lot,
Louie