]> granicus.if.org Git - php/commitdiff
Fix timezone var_dump from 51f2a5803fa4f09e212fed4b14ab8b4a003d4ef5
authorRemi Collet <remi@php.net>
Wed, 14 Feb 2018 07:59:24 +0000 (08:59 +0100)
committerRemi Collet <remi@php.net>
Wed, 14 Feb 2018 07:59:24 +0000 (08:59 +0100)
ext/date/php_date.c

index 82ac9a6502cf23501bc1734b5e94e5fdbfb6795e..2df19f718af22fa8ba601bad43c32851e2be28e1 100644 (file)
@@ -2422,9 +2422,9 @@ static HashTable *date_object_get_debug_info_timezone(zval *object, int *is_temp
                        zend_string *tmpstr = zend_string_alloc(sizeof("UTC+05:00")-1, 0);
 
                        ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
-                       tzobj->tzi.utc_offset > 0 ? '-' : '+',
-                       abs(tzobj->tzi.utc_offset / 60),
-                       abs((tzobj->tzi.utc_offset % 60)));
+                               tzobj->tzi.utc_offset < 0 ? '-' : '+',
+                               abs((int)(tzobj->tzi.utc_offset / 3600)),
+                               abs(((int)(tzobj->tzi.utc_offset % 3600) / 60)));
 
                        ZVAL_NEW_STR(&zv, tmpstr);
                        }