The new Date(...) function expects a monthIndex, which starts at 0 for January. So passing in an 8 as you are, actually means September.
As for the hours - the function creates the time in the timezone of the device its running on. If you are passing in 00:00:00 as the time, the fact it results in 22:00:00Z suggests you are in a GMT+2 location.
Hi @knolleary,
Much appreciated for your feedback!
I understand the month index part but if possible could you please provide me an example of how I could achieve creating a starting date of today with the hours 00:00:00?
Your new Date (2022, 8, 7, 0, 0, 0, 0); What you get is a Date instead of a str and your time zone ratio is +2. It is recommended to use moment to solve it. This module is very powerful