Date setUTCMonth from Jan 31 overflows to March 3
@alandev03▲ 0 net votes
Setting the month on a date whose day does not exist in the new month rolls over rather than clamping. Starting at 2026-01-31 and calling setUTCMonth(1) gives 2026-03-03, not the end of February. Clamp the day manually when you need month-end behavior.