Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50093 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15605 invoked from network); 3 Nov 2010 20:33:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Nov 2010 20:33:13 -0000 Authentication-Results: pb1.pair.com header.from=james.butler@edigitalresearch.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=james.butler@edigitalresearch.com; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain edigitalresearch.com does not designate 217.154.180.62 as permitted sender) X-PHP-List-Original-Sender: james.butler@edigitalresearch.com X-Host-Fingerprint: 217.154.180.62 analysis.edigitalresearch.com Linux 2.6 Received: from [217.154.180.62] ([217.154.180.62:33128] helo=mail.edigitalresearch.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/00-15374-607C1DC4 for ; Wed, 03 Nov 2010 15:33:11 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.edigitalresearch.com (Postfix) with ESMTP id 751201E3056; Wed, 3 Nov 2010 20:33:06 +0000 (GMT) X-Virus-Scanned: amavisd-new at edigitalresearch.com Received: from mail.edigitalresearch.com ([127.0.0.1]) by localhost (mail.edigitalresearch.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oNWJBnW2-oH6; Wed, 3 Nov 2010 20:33:05 +0000 (GMT) Received: from zarafa.localdomain (unknown [10.0.0.20]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.edigitalresearch.com (Postfix) with ESMTPS id A02501E3051; Wed, 3 Nov 2010 20:33:05 +0000 (GMT) Received: from zarafa.edigitalresearch.com (zarafa.edigitalresearch.com [10.0.0.20]) by zarafa.localdomain (Postfix) with SMTP id E253C10039C; Wed, 3 Nov 2010 20:33:04 +0000 (GMT) To: =?windows-1252?Q?"Stas_Malyshev"?= Cc: =?windows-1252?Q?"PHP_Internals"?= Date: Wed, 3 Nov 2010 20:33:04 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Mailer: Zarafa 6.40.2-22452 Message-ID: Subject: Re: [PHP-DEV] [PATCH] lenient datetime From: james.butler@edigitalresearch.com (=?windows-1252?Q?James_Butler?=) 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)=20 -- James Butler Sent from my iPhone On 3 Nov 2010, at 17:16, "Stas Malyshev" wrote: > Hi! >=20 > As I previously noted, in DateTime module there's no way to make=20 > DateTime format parser to parse the string if the string contains more=20 > data that the format supplies - i.e. if you need 'Y-m-d' and you have=20 > string '2010-11-02 12:30' - you can't make DateTime accept it without=20 > pre-parsing. The attached patch adds format character '+' that=20 > implements that - i.e., if you use format 'Y-m-d+' then the string=20 > '2010-11-02 12:30' will be parsed successfully, as well as '2010-11-02'=20 > and string with anything following the date. > The character would make the format 'lenient' when used in any position=20 > in the string, doesn't have to be at the end. >=20 > Any objections=3F If not, I'll add some unit tests and commit it. > --=20 > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >