derick Mon Mar 31 09:12:15 2008 UTC Added files: (Branch: PHP_5_2) /php-src/ext/date/tests timestamp-in-dst.phpt
Modified files: /php-src/ext/date php_date.c Log: - MFH: Fixed a bug in formatting timestamps when DST is active in the default timezone. http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.56&r2=1.43.2.45.2.57&diff_format=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.45.2.56 php-src/ext/date/php_date.c:1.43.2.45.2.57 --- php-src/ext/date/php_date.c:1.43.2.45.2.56 Sun Feb 3 14:22:55 2008 +++ php-src/ext/date/php_date.c Mon Mar 31 09:12:15 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_date.c,v 1.43.2.45.2.56 2008/02/03 14:22:55 derick Exp $ */ +/* $Id: php_date.c,v 1.43.2.45.2.57 2008/03/31 09:12:15 derick Exp $ */ #include "php.h" #include "php_streams.h" @@ -746,9 +746,9 @@ offset->abbr = strdup(t->tz_abbr); } else if (t->zone_type == TIMELIB_ZONETYPE_OFFSET) { offset = timelib_time_offset_ctor(); - offset->offset = (t->z - (t->dst * 60)) * -60; + offset->offset = (t->z) * -60; offset->leap_secs = 0; - offset->is_dst = t->dst; + offset->is_dst = 0; offset->abbr = malloc(9); /* GMT±xxxx\0 */ snprintf(offset->abbr, 9, "GMT%c%02d%02d", localtime ? ((offset->offset < 0) ? '-' : '+') : '+', http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/timestamp-in-dst.phpt?view=markup&rev=1.1 Index: php-src/ext/date/tests/timestamp-in-dst.phpt +++ php-src/ext/date/tests/timestamp-in-dst.phpt --TEST-- Format timestamp in DST test --INI-- date.timezone=CEST --FILE-- <?php error_reporting(E_ALL & ~E_STRICT); // hide e_strict warning about timezones var_dump( date_create( '@1202996091' )->format( 'c' ) ); ?> --EXPECT-- string(25) "2008-02-14T13:34:51+00:00" --UEXPECT-- unicode(25) "2008-02-14T13:34:51+00:00" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php