Hi!

The bug 51866 was reclassified as docs bug, but I still think it makes a lot of sense to allow for lenient date parsing. And it's quite easy to do IMHO - the parser can easily stop at the end of the data or format it needed and not treat it as an error. And it would help working with user date/time inputs where parts can be missing and format it not known to the code (i.e. user-defined). Since with user-specified format it's hard to know what is missing without actually parsing the date, so making code that can parse both date+time and just date (assuming, for example, midnight of the same date) is a lot harder than it should be.

So, I propose making some option that would allow the parser to parse strings that have less or more data than the pattern requires. It may be implemented either as format character (I'd suggest ? at the end) or as an optional parameter. What do you think?
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to