iansinnott / jstz

🌐Timezone detection for JavaScript
Other
175 stars 33 forks source link

Timezone name for India is not correct #23

Open JagdishUpadhyay opened 5 years ago

JagdishUpadhyay commented 5 years ago

Hi

Thanks for this awesome library. However I am facing an minor issue related with India timezone. If we use jstz.determine().name() to detect user current timezone it is returning "Asia/Calcutta", which is correct. However if we use jstz.olson.timezones to fetch all time zones, the timezone for India is named as "Asia/Kolkata". It seems that there are mismatch between these two functions.

nadelicious commented 4 years ago

@JagdishUpadhyay The "Asia/Calcutta" time zone has been deemed obsolete. It has been replaced by "Asia/Kolkata".

http://www.timezoneconverter.com/cgi-bin/zoneinfo.tzc?s=default&tz=Asia/Calcutta

mcleanmds commented 4 years ago

Also to note: Blink/V8 browsers (e.g. Chrome/Edge-chromium) appear to still be affected by a related bug in their I18N implementation (raised 2016): https://bugs.chromium.org/p/chromium/issues/detail?id=580195

This impacts what is returned by Intl.DateTimeFormat().resolvedOptions().timeZone as used in get_from_internationalization_api

This doesn't affect FireFox as their JS engine I18N implementation returns the correct string.