Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53352 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17214 invoked from network); 17 Jun 2011 11:40:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jun 2011 11:40:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:38997] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/64-17668-53D3BFD4 for ; Fri, 17 Jun 2011 07:40:38 -0400 Received: from localhost (xdebug.org [127.0.0.1]) by xdebug.org (Postfix) with ESMTPS id E05F6DE13E; Fri, 17 Jun 2011 12:40:33 +0100 (BST) Date: Fri, 17 Jun 2011 12:40:34 +0100 (BST) X-X-Sender: derick@whisky To: Richard Quadling cc: Stas Malyshev , PHP Internals In-Reply-To: Message-ID: References: <4DFA96ED.90800@sugarcrm.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-1180722131-1308310435=:4180" Subject: Re: [PHP-DEV] date_diff broken? From: derick@php.net (Derick Rethans) --8323328-1180722131-1308310435=:4180 Content-Type: TEXT/PLAIN; CHARSET=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 17 Jun 2011, Richard Quadling wrote: > On 17 June 2011 00:51, Stas Malyshev wrote: > > > > As you can see, the date in $start changed, even though it shouldn't ha= ppen. > > Looks like it's because of timelib_diff() which has this: > > > > =C2=A0 =C2=A0timelib_apply_localtime(one, 0); > > =C2=A0 =C2=A0timelib_apply_localtime(two, 0); > > > > which converts times in diff arguments to localtime. It then does: > > > > =C2=A0 =C2=A0timelib_apply_localtime(one, 1); > > =C2=A0 =C2=A0timelib_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 b= y > > 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=20 that's not supposed to happen. I see why this happens in the library,=20 let me think of a way on how to fix this in a clean way. cheers, Derick --=20 http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug --8323328-1180722131-1308310435=:4180--