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: > > [EMAIL PROTECTED]:/dat/dev/php/php-5.0dev$ cat > ext/standard/tests/time/bug30096.php > <?php > echo gmdate("H:i:s Y-m-d", gmmktime(02,00,01, 03,28,2004)); > ?> > > [EMAIL PROTECTED]:/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: [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php