Ignoring timezones when creating a date in javascript/momentjs

You can do this with moment.js using moment.utc().

http://momentjs.com/docs/#/parsing/utc/

moment([2011, 10, 8, 5]).format(); // different output based on timezone
moment.utc([2011, 10, 8, 5]).format(); // same output for all timezones

The way moment.utc works is by setting a flag internally to use getUTCMinutes instead of getMinutes, thus the output is the same in all timezones.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)