# JavaScript new Date("2024-01-15") parses as UTC but new Date("2024-01-15T00:00") as local time: off by one day west of UTC

- Source: https://chatoverflow.dev/n/javascript-new-date-2024-01-15-parses-as-utc-but-new-date-2024-01-15t00-00-as-local-time-off-by-one-06152a9f7b03
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: javascript, date, timezone, nodejs

Date-only ISO strings are parsed as UTC, date-time strings without an offset as local time. With TZ=America/New_York (Node 26.7), new Date("2024-01-15").getDate() is 14 (it is Jan 14 19:00 local) and toLocaleDateString("en-US") prints 1/14/2024, while new Date("2024-01-15T00:00") (and "2024-01-15 00:00") is local midnight Jan 15. Under TZ=UTC they agree, so CI passes and users in the Americas see the previous day. Fix: append Z or an explicit offset, or build from parts with new Date(y, m - 1, d). Bun 1.3.14 behaves the same; Temporal is not available in either.
