I am use moment library for getting time zone
moment.tz.guess()
which is returning 'Asia/Calcutta' (old name), instead of that I want the latest name which is 'Asia/Kolkata' (new name).
Or any other way to get this new name time zone.
I am use moment library for getting time zone
moment.tz.guess()
which is returning 'Asia/Calcutta' (old name), instead of that I want the latest name which is 'Asia/Kolkata' (new name).
Or any other way to get this new name time zone.
As Felix suggested, just make the replacement on your end:
let timezoneGuess = moment.tz.guess();
timezoneGuess = timezoneGuess.replace("Calcutta","Kolkata");
This code tries to find "Calcutta" in the timezone name and, if it's there, replaces it with "Kolkata."