Comment by hombre_fatal
Comment by hombre_fatal 2 days ago
Then again, I don’t think you pass user input directly into a date constructor in any language, in practice.
You decide on the format that makes sense for the user, you validate the input against that format, and then you map it into a native date.
If the date constructor supports the format you want, it’s only coincidence that makes that final mapping step simpler.
So, the native date constructor having weird behavior on invalid strings doesn’t really change real world code.