Weird Date parsing issue?
sidcarton1587
Posts: 54
So I'm trying to rationalize what's going on with Date objects and coming up empty.
The documentation claims that Date string interchange format is:
-
YYYY-MM-DDTHH:mm:ss.sssZ
And if I look at an object, like a Product, that has a datetime, it does look like it's in that format:
"2025-09-03T03:00:00.000Z"
But when I try to execute Date.parse( "2025-09-03T03:00:00.000Z") it returns a NaN
But if I Date.parse ("2025/09/03 03:00:00") it correctly returns the milleseconds since 1/1/1970
Thoughts? I would hate to have to reformat the datetime string every time I need to parse it. Very annoying.
