"Invalid Date" in JavaScript — What It Means and How to Fix It

What the JavaScript error "Invalid Date" means and how to fix it.

Published October 30, 2026

"Invalid Date" is occurs when the Date constructor is given a string or value it can't parse into a valid date.

Key points

  • Check the browser console's stack trace to find exactly which line and call triggered the error

Example

new Date('not a date')  // Invalid Date
More JavaScript articles