my js file looks like below
var today = Date();
console.log(today); // Thu Aug 04 2022 15:28:52 GMT+0530 (India Standard Time)
var today = new Date();
console.log(today); // 2022-08-04T09:58:52.640Z
I have set the local timezone in my centos to Asia/Calcutta and its Date()
function is displaying correctly as Aug 04 2022 15:28:52
, how do I make even new Date()
to output the same data in my nodejs script.