26
rated 0 times
[
33]
[
7]
/ answers: 1 / hits: 20360
/ 9 Years ago, fri, november 13, 2015, 12:00:00
I would like to get the timezone difference between New York and Hong Kong with Node.js moment module. I have done some preliminary work.
var NewYork_time_hr = moment().tz(America/New_York).format('HH');
var HongKong_time_hr = moment().tz(Asia/Hong_Kong).format('HH');
I can then proceed to write a function to calculate the difference between the 2 timezones in hours. I was hoping for a simpler method.
Is there a more elegant and simpler way to do it with moment library?
More From » node.js