Re: date_diff broken?
| From: | Derick Rethans | Date: | Fri, 17 Jun 2011 11:40:34 +0000 |
| Subject: | Re: date_diff broken? | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53352@lists.php.net to get a copy of this message | ||
On Fri, 17 Jun 2011, Richard Quadling wrote:
> On 17 June 2011 00:51, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
> >
> > As you can see, the date in $start changed, even though it shouldn't happen.
> > Looks like it's because of timelib_diff() which has this:
> >
> > timelib_apply_localtime(one, 0);
> > timelib_apply_localtime(two, 0);
> >
> > which converts times in diff arguments to localtime. It then does:
> >
> > timelib_apply_localtime(one, 1);
> > timelib_apply_localtime(two, 1);
> >
> > which is supposed to convert them back, but in fact it does not, since first
> > conversion seems to have killed TZ information. I'd propose to fix it by
> > making time_diff operate on copies of one and two instead of real
> > structures, but maybe somebody has a better idea?
Well, we need to check on why the TZ information got killed actually. As
that's not supposed to happen. I see why this happens in the library,
let me think of a way on how to fix this in a clean way.
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug