Re: BUG 55240 - wrong date creation
| From: | Derick Rethans | Date: | Wed, 03 Aug 2011 20:10:04 +0000 |
| Subject: | Re: BUG 55240 - wrong date creation | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-54325@lists.php.net to get a copy of this message | ||
On Wed, 3 Aug 2011, Nicolai Scheer wrote:
> On 03.08.2011 21:29, Joey Smith wrote:
> >> 2011/8/4 Nicolai Scheer <scope@planetavent.de>:
> >>> 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