When I receive UTC date and the accept-language from a request, I want to convert that UTC date to timezone date (timezone should be relevant to the accept-language value).
If I can get timezone name from the locale, I can use formatInTimeZone function from date-fns-tz to convert UTC date.
So I want to extract time zone name ex:- "Africa/Cairo" from accept language header value ex: "ar-EG". I tried this
let arEG = new Intl.Locale("ar-EG");
console.log(arEG.timeZones); // logs ["Africa/Cairo"]
but it gives undefined.