I'm trying to get the datetime with daylight savings.
alert(new Date());
Gives me Thu Apr 04 2019 12:10:42 GMT+1100 (Australian Eastern Daylight Time)
alert(new Date(2019,4,4));
Gives me Sat May 04 2019 00:00:00 GMT+1000 (Australian Eastern Standard Time)
Why the first result is correct and the second result is incorrect given that, today's date is actually 2019/04/04
.
Also the second result does not considers the Daylight savings time.