You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Different timestamp created by node.js and browser #9805
@Pustur#4318 was the PR that changed that, you can follow the links/discussion there. Tbh, I find it a bit weird that the ISO representation is used as the more “human-readable” format (which is what util.inspect is supposed to show), but I am pretty sure you could have endless arguments about that. :)
@EasonWang01 > sorry about that,another stupid question.
Not stupid at all! I was just thinking the world was upside down when I saw it logged to different formats! I'm happy I found your question, it was really educational for me
Activity
addaleax commentedon Nov 26, 2016
Could you please give an example of Node.js and browser output, to show what you think is wrong?
EasonWang01 commentedon Nov 26, 2016
the node one is 07:xx:xx
but browser is 15:xx:xx
addaleax commentedon Nov 26, 2016
Those are the same date, just displayed differently. The
Zin2016-11-26T07:41:09.319Zstands for UTC+0, and you’re in UTC+8.You can check this by using
new Date().toString()andnew Date().toJSON(): Both of these will return the same value in Node.js and your browser.EasonWang01 commentedon Nov 26, 2016
sorry about that,another stupid question.
addaleax commentedon Nov 26, 2016
@EasonWang01 Don’t worry about it, I’m glad I could help!
Pustur commentedon Dec 12, 2016
@addaleax: Hey there, i was wondering why the default format has been changed to an ISO string? Is there a reason?
Just curious since it caused me some trouble that i wasn't expecting :P
Thanks
addaleax commentedon Dec 12, 2016
@Pustur #4318 was the PR that changed that, you can follow the links/discussion there. Tbh, I find it a bit weird that the ISO representation is used as the more “human-readable” format (which is what
util.inspectis supposed to show), but I am pretty sure you could have endless arguments about that. :)haffedali commentedon Nov 6, 2019
@EasonWang01 > sorry about that,another stupid question.
Not stupid at all! I was just thinking the world was upside down when I saw it logged to different formats! I'm happy I found your question, it was really educational for me