Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54326 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25708 invoked from network); 3 Aug 2011 20:18:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2011 20:18:58 -0000 Authentication-Results: pb1.pair.com header.from=lonnyk@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lonnyk@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) X-PHP-List-Original-Sender: lonnyk@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:42004] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/57-23811-03DA93E4 for ; Wed, 03 Aug 2011 16:18:56 -0400 Received: by qwi4 with SMTP id 4so464537qwi.29 for ; Wed, 03 Aug 2011 13:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=X9upyKojMZGff4GCIgk9SsZmVunPiFq5maaeysJdmK8=; b=MOsCqyTuVF+DgL5XJpd+NUg0fSpbeYj+4QtDIZhwDI//C5uEAV9etc7QYfyKBGiWH+ dOTz5KRK18voNkwxDepSkkyuDvsLTrnBAp4rlCziHcrDHvR/NQs6m6YT8q2ZodHidySJ 5j13GW5B83VwhrqipXwt11iCkS7VsHKfSFxLU= MIME-Version: 1.0 Received: by 10.224.27.75 with SMTP id h11mr5682827qac.231.1312402733475; Wed, 03 Aug 2011 13:18:53 -0700 (PDT) Received: by 10.224.47.78 with HTTP; Wed, 3 Aug 2011 13:18:53 -0700 (PDT) In-Reply-To: References: <4E397879.4080007@planetavent.de> <20110803192954.GA8856@joeysmith.com> <4E39A974.7080405@planetavent.de> Date: Wed, 3 Aug 2011 16:18:53 -0400 Message-ID: To: Derick Rethans Cc: Nicolai Scheer , internals@lists.php.net Content-Type: multipart/alternative; boundary=bcaec51b15f7bb276d04a99f9248 Subject: Re: [PHP-DEV] BUG 55240 - wrong date creation From: lonnyk@gmail.com (Lonny Kapelushnik) --bcaec51b15f7bb276d04a99f9248 Content-Type: text/plain; charset=ISO-8859-1 In the date() function the formats are split up. In date() G is w/o leading zeros and H is w/ leading zeros. Why were these (as well as many others) combined and turned into an either/or for DateTime::createFromFormat? On Wed, Aug 3, 2011 at 4:10 PM, Derick Rethans wrote: > On Wed, 3 Aug 2011, Nicolai Scheer wrote: > > > On 03.08.2011 21:29, Joey Smith wrote: > > >> 2011/8/4 Nicolai Scheer : > > >>> Hi! > > >>> > > >>> Did anyone had the time to review bug 55240 > > >>> (https://bugs.php.net/bug.php?id=55240), yet? > > >>> > > > > > > It definitely appears to be unexpected behaviour - the 'G' format for > > > hours is "24-hour format without leading zeroes" - so the expectation > > > would be that 'Gi' parses '800' as '8 hours and 0 minutes'. (Also, I > > > thought I would point out here that the comments on 'G' and 'H', in > > > timelib_parse_from_format are backwards here - same with 'g' and 'h'.) > > > > Unfortunately, there's nothing I could do about the strings to be parsed > > (in terms of customer agreement...). > > > > "24-hour format without leading zeroes" is exactly what I had expected > > from the 'G' format as well. "24-hour" somehow implies "not greater than > > 24". On the other hand "overflow" handling might be expected (and even a > > good thing to do?). > > > > Let's see what others are about to comment on the issue... > > Personally I'd vote for "fixing" this by limiting the parsed value. > > Another possibility would be to introduce a new format without the > > "overflow handling"... > > Yes, this needs fixing. I am not sure how easy this is though... > I've assigned the bug to myself. > > cheers, > Derick > > -- > http://derickrethans.nl | http://xdebug.org > Like Xdebug? Consider a donation: http://xdebug.org/donate.php > twitter: @derickr and @xdebug > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --bcaec51b15f7bb276d04a99f9248--