]> granicus.if.org Git - php/commitdiff
Set timezone for intl/test/bug74298.phpt
authorJesper Hagström <Jesper.hag@gmail.com>
Fri, 2 Jun 2017 13:29:04 +0000 (15:29 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 2 Jun 2017 21:40:48 +0000 (23:40 +0200)
Now sets UTC as default timezone for the DateTime which otherwise
uses the timezone defined in php.ini.

ext/intl/tests/bug74298.phpt

index 0600a46b9c7940e0857a3a9a0465dcba447e6cdc..0bfb59b48e83650756abc2d3982cae4ec55026b3 100644 (file)
@@ -13,7 +13,7 @@ var_dump((new \IntlDateFormatter(
     'UTC',
     \IntlDateFormatter::GREGORIAN,
     'yyyy-MM-dd HH:mm:ss.SSSSSS'
-))->format(new \DateTime('2017-01-01 01:02:03.123456')));
+))->format(new \DateTime('2017-01-01 01:02:03.123456', new \DateTimeZone('UTC'))));
 
 var_dump(datefmt_create(
     'en-US',
@@ -22,7 +22,7 @@ var_dump(datefmt_create(
     'UTC',
     \IntlDateFormatter::GREGORIAN,
     'yyyy-MM-dd HH:mm:ss.SSSSSS'
-)->format(new \DateTime('2017-01-01 01:02:03.123456')));
+)->format(new \DateTime('2017-01-01 01:02:03.123456', new \DateTimeZone('UTC'))));
 ?>
 --EXPECTF--
 string(26) "2017-01-01T01:02:03.123456"