3 ms·
I don't know which specific function you're talking about, but there may be a good reason for it.
by TazeTSchnitzel 14y ago
I don't know which specific function you're talking about, but there may be a good reason for it.
- juan_juarez 14y agoBoth strtotime() - PHP's "take a string and do your damnedest to make a date out of it" function - and DateTime.parseFromFormat() - the more restrictive TZ-aware class - accept it and give you March 2/3. There's a separate validate_date() or something like that that actually rejects Feb 31.
- TazeTSchnitzel 14y agoI'm not sure that's entirely wrong, just a different attitude than you might expect. Also, for that matter, I think MySQL accepts, will store, and will retrieve Feb 31 IIRC. Why? It's liberal in the correctness of input.