Like the idea,
Couple of questions...

What would happen if the string contained a matching pattern twice or me, which 
would be 'returned', also does this allow the rest of the string to be pretty 
much junk.

(haven't had time to test patch as miles from a computer) 

--
James Butler
Sent from my iPhone

On 3 Nov 2010, at 17:16, "Stas Malyshev" <smalys...@sugarcrm.com> wrote:

> Hi!
> 
> As I previously noted, in DateTime module there's no way to make 
> DateTime format parser to parse the string if the string contains more 
> data that the format supplies - i.e. if you need 'Y-m-d' and you have 
> string '2010-11-02 12:30' - you can't make DateTime accept it without 
> pre-parsing. The attached patch adds format character '+' that 
> implements that - i.e., if you use format 'Y-m-d+' then the string 
> '2010-11-02 12:30' will be parsed successfully, as well as '2010-11-02' 
> and string with anything following the date.
> The character would make the format 'lenient' when used in any position 
> in the string, doesn't have to be at the end.
> 
> Any objections? If not, I'll add some unit tests and commit it.
> -- 
> 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
> <lenient_date.diff>


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

Reply via email to