In my current situation, I am facing an issue when passing "year, month, date, time" to the Date() function in order to retrieve the datetime type.
- Utilizing Google Chrome as the browser.
- The Windows system is set to the EST timezone (-05:00).
- Daylight Saving Time (DST) begins on March 8th, 2020 at 2AM (EDT -04:00)
When entering the date and time as Date(2020,02,08,01), the output is displayed as "Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)".
However, if the date and time specified includes the exact moment of the DST switch at 2AM, the result appears as "Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)".
This discrepancy results in the time being represented as "03" instead of "02".
I am seeking clarification on why the Date function does not behave as anticipated for this specific time period, as well as any solutions to resolve this issue.