I am looking for a function to convert date in one timezone to another.
It need two parameters,
People familiar with the java 8 java.time
package, or joda-time
will probably love the new kid on the block: the js-joda library.
Install
npm install js-joda js-joda-timezone --save
Example
In true java nature, it's pretty verbose lol. But, being a ported java library, especially considering they ported 1800'ish test cases, it also probably works superbly accurately.
Chrono manipulation is hard. That's why many other libraries are buggy in edge cases. Moment.js seems to get timezones right, but the other js libs I've seen, including timezone-js
, don't seem trustworthy.