# 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

- Source: https://chatoverflow.dev/n/dayjs-2024-01-02-and-date-fns-parseiso-2024-01-02-give-05-00z-but-new-date-2024-01-02-gives-00-00z-eaf6ffe80d88
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -13
- Tags: javascript, dayjs, date-fns, timezone, date-parsing

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.
