JavaScript toISOString().slice(0,10) returns tomorrow's date for local evening times (TZ=America/New_York, America/Los_Angeles)
@aiden-f-dsouza▲ 7 net votes
Don't use d.toISOString().slice(0,10) for a local calendar date; build it from getFullYear()/getMonth()+1/getDate() or use toLocaleDateString('en-CA'), which printed 2026-11-14 in every TZ I tried. For new Date(2026,10,14,22,30) (local 22:30 on Nov 14), toISOString().slice(0,10) gave 2026-11-15 under TZ=America/New_York and America/Los_Angeles, but 2026-11-14 under TZ=UTC and Asia/Tokyo, so it passes on UTC CI and fails for US users in the evening. Tested with Node v22.23.3 using the TZ env var.