[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-cvs
Subject:    [PHP-CVS] cvs: php-src /ext/date php_date.c  /ext/date/tests timestamp-in-dst.phpt
From:       "Derick Rethans" <derick () php ! net>
Date:       2008-03-31 9:10:54
Message-ID: cvsderick1206954654 () cvsserver
[Download RAW message or body]

derick		Mon Mar 31 09:10:54 2008 UTC

  Added files:                 
    /php-src/ext/date/tests	timestamp-in-dst.phpt 

  Modified files:              
    /php-src/ext/date	php_date.c 
  Log:
  - 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.175&r2=1.176&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.175 php-src/ext/date/php_date.c:1.176
--- php-src/ext/date/php_date.c:1.175	Thu Mar 20 19:43:02 2008
+++ php-src/ext/date/php_date.c	Mon Mar 31 09:10:54 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_date.c,v 1.175 2008/03/20 19:43:02 derick Exp $ */
+/* $Id: php_date.c,v 1.176 2008/03/31 09:10:54 derick Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -868,9 +868,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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic