Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13867 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6509 invoked by uid 1010); 15 Nov 2004 17:24:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 6420 invoked from network); 15 Nov 2004 17:24:26 -0000 Received: from unknown (HELO marvin.mindnever.org) (80.74.160.83) by pb1.pair.com with SMTP; 15 Nov 2004 17:24:26 -0000 Received: (qmail 6244 invoked by uid 509); 15 Nov 2004 18:15:15 -0000 Received: from bunuel-cpe-185-bgd.sbb.co.yu (HELO mravojed.office.kom) (82.117.196.185) by marvin.mindnever.org with SMTP; 15 Nov 2004 18:15:11 -0000 To: Derick Rethans Cc: internals@lists.php.net In-Reply-To: References: <1100531086.4084.9.camel@mravojed> Content-Type: text/plain Organization: MindNever Dot Org Message-ID: <1100539460.4084.56.camel@mravojed> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Mon, 15 Nov 2004 18:24:20 +0100 Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on leya.mindnever.org X-Spam-Level: X-Spam-Status: No, hits=-2.7 required=4.0 tests=AWL,BAYES_00,RCVD_IN_SBL, SUBJ_HAS_UNIQ_ID autolearn=no version=2.63 Subject: Re: [PHP-DEV] Fix for php4 bug #30096 From: vladimir@mindnever.org (Vladimir Zidar) But then whole function php_mktime() is wrong, as in case where gm=1, you expect that parameters you pass are GMT, and still you fill defaults with localtime. Also, later, if gm=1, timezone adjustment is in use, but with parameters that are in GMT. So the real good fix would be to remove timezone stuff completly out of there, and make another function in pair with php_localtime_r, that returns GMT, and to use it when gm=1. On Mon, 2004-11-15 at 17:54, Derick Rethans wrote: > On Mon, 15 Nov 2004, Vladimir Zidar wrote: > > > So the fix is easy: > > > > --- ext/standard/datetime.c.orig Fri Nov 12 22:35:04 2004 > > +++ ext/standard/datetime.c Fri Nov 12 22:35:33 2004 > > @@ -256,7 +256,7 @@ > > gmadjust = -(is_dst ? timezone - 3600 : timezone); > > #endif > > #endif > > - seconds += gmadjust; > > + seconds -= gmadjust; > > } > > > > RETURN_LONG(seconds); > > This fix is wrong, the example now returns definitely the wrong answer: > > derick@kossu:/dat/dev/php/php-5.0dev$ cat ext/standard/tests/time/bug30096.php > echo gmdate("H:i:s Y-m-d", gmmktime(02,00,01, 03,28,2004)); > ?> > > derick@kossu:/dat/dev/php/php-5.0dev$ sapi/cli/php ext/standard/tests/time/bug30096.php > 23:00:01 2004-03-27 > > This bug has nothing to do with the wrong direction of the adjustment, > but more with the chancing to DST at that date. > > regards, > Derick -- Vladimir Zidar, Programmer MindNever Foodstuff TRDG. Head Office Branch Tel: +381-63-550161, +385-98-9574261 http://www.mindnever.org, icq: 15414204, mail: mr_W@mindnever.org