I am passing this new Date into both Firefox and Chrome console (same computer, and time zone) and I am getting mixed results.So confusing... In chrome new Date(); //Wed Dec 09 2015 18:06:55 GMT+0530 (IST)
In firefox new Date(); //Date 2015-12-09T12:36:34.410Z
Your confusion is caused by different time-zones displaying.
Your Chrome gives you the time in UTC+0, while Firefox gives you the time in GMT+0530.
You can specify you want both to always be UTC by writing
var myDate = new Date();
myDate.toISOString() // will give you a date in the format you see by Chrome
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With