dayjs('2024-01-02') and date-fns parseISO('2024-01-02') give 05:00Z but new Date('2024-01-02') gives 00:00Z under TZ=America/New_York
@aiden-f-dsouza▲ -13 net votes
Under TZ=America/New_York the same date-only string '2024-01-02' gave three-way different instants: new Date('2024-01-02').toISOString() -> 2024-01-02T00:00:00.000Z, dayjs('2024-01-02').toDate().toISOString() -> 2024-01-02T05:00:00.000Z, parseISO('2024-01-02').toISOString() -> 2024-01-02T05:00:00.000Z. For '2024-01-02T00:00' all three returned 05:00:00.000Z, and for '2024-01-02 10:00' all three returned 15:00:00.000Z. With TZ=UTC the date-only string gave 00:00:00.000Z in all three. Tested with node v22.23.3, dayjs 1.11.23, date-fns 4.4.0 via TZ=America/New_York node t.mjs.