You may wish to refer to this Date() constructor documentation.
Please see the following information when passing through Individual date and time component values as parameters into the
Given at least a year and month, this form of
Date() returns a
Date object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (
0 for every other component). The parameter values are all evaluated against the local time zone, rather than UTC.
In addition to this, the
monthIndex is an Integer value representing the month, beginning with
0 for January to
11 for December. In your example, you have passed in a value of
1 for the
I would recommend using the ISO Date string format instead:
Note: this constructor variation assumes UTC +0 (aka Z for Zulu time) for the date string.
A UTC offset can be included in the string, eg:
Hope this helps!