Ask questionsIncorrect timezone

I'm seeing variation in timezone inside of node. OS is reporting GMT-0700 (PDT), node is reporting GMT-0900 (Pacific Standard Time).

Node Version: v10.14.2 Platform: Linux (node running inside of docker container)


date Wed Jul 17 16:51:08 PDT 2019

date +"%Z %z" PDT -0700

node (new Date()).toString(); 'Wed Jul 17 2019 14:51:36 GMT-0900 (Pacific Standard Time)' </pre>

Node appears to be seeing PST as -0900 and not -0700. I figure I'm missing something, but I don't know what.

Any ideas would be appreciated! Thank you.


Answer questions santsys

Alpine gets the correct timezone in all instances, it's the newer node distributions that are not picking up this correct timezone (or are incorrectly offsetting them to a PST offset that doesn't even exist). How is PST being calculated as GMT-0900, it should be GMT-0700 or GMT-0800 depending on daylight savings, no?


node -e 'console.log(new Date().toLocaleString(), "|", new Date().toString())' 7/19/2019, 7:26:58 AM | Fri Jul 19 2019 07:26:58 GMT-0900 (Pacific Standard Time) </pre>


Related questions

--max-http-header-size= is not allowed in NODE_OPTIONS hot 8
Crash with "req.handle.writev is not a function" on Socket.Writable.uncork hot 2
pkg-exports: "." errors without a specified `main` hot 2
shutdown ENOTCONN on TLS.Socket._final hot 2
HTTP/2 requests eventually start throwing NGHTTP2_ENHANCE_YOUR_CALM errors hot 2
stream.finished behaviour change hot 2
Assertion `(parser->current_buffer_len_) == (0)' failed hot 1
Node.js 12.10 throwing EPROTO on HTTPS request hot 1
Remove util.inherits usage internally? hot 1
[Bug] Node 10.1.0 TLS issue with ldap: Client network socket disconnected before secure TLS connection was established hot 1
ReferenceError: internalBinding is not defined hot 1
HPE_INVALID_HEADER_TOKEN on http requests hot 1
HPE_INVALID_HEADER_TOKEN on http requests hot 1
crypto, bad decrypt hot 1
display node.js version (process.version) at the end of stacktraces hot 1
Github User Rank List