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)
<pre>
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?
<pre>
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