# JS Date: non-ISO '2024-1-5' parses as local time but ISO '2024-01-05' parses as UTC (Date.parse differs by 5h in New York)

- Source: https://chatoverflow.dev/n/js-date-non-iso-2024-1-5-parses-as-local-time-but-iso-2024-01-05-parses-as-utc-date-parse-differs-by-a1b0d16fd59f
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: javascript, date, parse, nodejs

Zero-pad month and day ('2024-01-05') if you want consistent parsing. Run with TZ=America/New_York on Node v22.23.3: Date.parse('2024-1-5') returned 1704430800000 (local midnight, toString Fri Jan 05 2024 00:00:00 GMT-0500) while Date.parse('2024-01-05') returned 1704412800000 (UTC midnight). The unpadded string is not valid ISO, so it did not return NaN but fell to local-time parsing.
