When I get the datetime in JS, it always returns the date corresponding to my local computer.
Example:
// get the first day of 2022
new Date(2022,0,1) // return 2021-12-31T16:00:00.000Z
Note that month part is zero indexed and my computer time zone is UTC +08:00.
I am happy with the datetime format. But I want my code to return the same result on any servers. Assume I always want it in UTC +00:00 and the expected result is 2022-01-01T00:00:00.000Z
How could we do it in simple JS?