If not a bug, how to tell node my timezone? If bug, is this reported already?
If it is a bug, it does not exist in my version of Node. It is true that the Node.js REPL prefers to announce in GMT in my version:
> new Date()
Sat, 31 Mar 2012 21:51:47 GMT
But it is in fact timezone-aware, that is just not what the REPL shows when stringifying it:
> new Date().getTimezoneOffset()
-120
> "" + new Date()
'Sat Mar 31 2012 23:51:56 GMT+0200 (CEST)'
(I am running Node.js v0.6.1 on Ubuntu.)
This is not a bug, just a choice of how Node decides to represent a Date
object in its REPL. Also, as of node v0.7.x
, this output has been changed to display local time, matching the browser behavior:
☮ ~ (master) ⚡ node
> process.version
'v0.7.7'
> new Date
Sat Mar 31 2012 15:12:13 GMT-0700 (PDT)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With