How come my javascript (node.js) is giving me the incorrect timestamp?

前端 未结 4 1546
攒了一身酷
攒了一身酷 2021-01-12 02:39

I typed \"date\" in console...and I get Tue Sep 20 01:01:49 PDT 2011 ...which is correct.

But then I do this in node.js, and I get the wrong time.

4条回答
  •  有刺的猬
    2021-01-12 03:19

    date in console will return the server time, whereas using JavaScript on a webpage will return the client's local time.

提交回复
热议问题