Given two different IANA (aka "tz database" or "Olson") time zones, how can I determine if they represent the same zone?
For example, Asia/Kolkata
and Asia/Calcutta
represent the same zone.
Another example, Africa/Asmara
and Africa/Asmera
represent the same zone.
These minor spelling differences matter when using APIs that detect or guess the user's time zone, as one cannot then simply compare strings to a previously stored value, because different implementations return different variations of the time zone identifier.
Modern JavaScript implementations that fully support the ECMAScript Internationalization API, can use the following:
For applications requiring compatibility with older browsers, Moment-Timezone can be leveraged: