On 8/19/20 10:17 AM, Matt Johnson-Pint wrote:
If you need to support older browsers, you can either use one of the previously mentioned libraries and also add the Intl Polyfill (https://github.com/formatjs/date-time-format-timezone), or you can use Moment-Timezone (https://momentjs.com/timezone/), which is an add-on for Moment.js (https://momentjs.com/). With either one, your app would carry some form of the tzdata with it.
Thanks for mentioning that. Although tz-link.html already mentioned Moment-Timezone, the timeZone option of JavaScript's Intl.DateTimeFormat is also worth mentioning as it can be a string like "America/Los_Angeles". I added the attached proposed patch to the development sources. It seems that pretty much every JavaScript runtime except Internet Explorer supports tz names in the timeZone option nowadays, though older versions of runtimes may lack this support. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Obj...