javascript - Can I make node.js Date always be in UTC/GMT? -
my app runs on linux servers, time (naturally) set utc/gmt. app developed on mac desktops time typically set local timezone.
i change every new date()
in code run:
var date = new date().gettime();
and ensure dates on server gmt, seems inelegant.
i understand previous versions of node used return utc/gmt. there way bring behavior back?
edit: removed adding timezone offset gettime() per comments - since gettime() in utc.
you can use tz
configuration parameter of node.js follows
export tz=utc nodejs server/index.js
Comments
Post a Comment