I am trying to console.log Date object in Windows PowerShell by executing Node.js:
node -e "var d = new Date();console.log('new date = ', d);"
However, the PowerShell doesn't give me any date. The only thing I am getting is:
new date=
All other type of data get printed out, including time.
The only way I found to see the date in PowerShell is to add .toString() to my code:
node -e "var d = new Date();console.log('new date = ', d.toString());"
I don't have this problem in a simple CMD on the same system (Windows10Pro).
The above code (node -e "var d = new Date();console.log('new date = ', d);") gets printed:
new date= 2020-03-14T22:46:49.847Z
If anyone has any idea how to solve this, I will appreciate a lot your help.
