This is my first post here, so forgive me if I'm doing this wrong. I am incrementing a year's worth of dates as follows:
for (i = 0; i <= 360; i++){
bDate.setDate(bDate.getDate() + 1);
bArray.push([Utilities.formatDate(bDate, "GMT", "M/dd/YYYY")]);
}
It works just fine until 12/25/2021, at which point Apps Script decides to celebrate New Year's a few days early!!! See below:
[12/22/2021], [12/23/2021], [12/24/2021], [12/25/2021], [12/26/2022], [12/27/2022], [12/28/2022], [12/29/2022], [12/30/2022], [12/31/2022], [1/01/2022], [1/02/2022]
Am I doing something wrong or is this some sort of bug?