Home  >  Q&A  >  body text

javascript - Why is the time displayed when nodejs runs the Date function inaccurate?

var d = new Date();
console.log(d);

The output result is

2017-06-09T12:55:35.514Z
[Finished in 0.6s]

The time output by the browser is 20:57:47, which is the correct system time. Why is this?

淡淡烟草味淡淡烟草味2666 days ago670

reply all(2)I'll reply

  • 阿神

    阿神2017-06-10 09:50:34

    UTC time output by node,
    Local time output by browser

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-06-10 09:50:34

    Found it, the UTC time output by node is Beijing time.
    UTC time and Beijing time check:
    http://zh.thetimenow.com/utc/...

    reply
    0
  • Cancelreply