mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
44a9e6b484
This fixes the issue in https://wiki.php.net/rfc/datetime_and_daylight_saving_time#forward_transitions There is a period during transition to DST where a time (such as 02:30) does not exist. PHP already calculated the correct timestamp for this, but failed to "rounded forward" to the existing correct hour value.
28 lines
899 B
PHP
28 lines
899 B
PHP
--TEST--
|
|
Test for Date/Time construction during a forward DST transition
|
|
--FILE--
|
|
<?php
|
|
date_default_timezone_set('America/New_York');
|
|
|
|
$date = new DateTime('2010-03-14 01:30:00');
|
|
echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
|
|
|
|
$date = new DateTime('2010-03-14 02:00:00');
|
|
echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
|
|
|
|
$date = new DateTime('2010-03-14 02:30:00');
|
|
echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
|
|
|
|
$date = new DateTime('2010-03-14 03:00:00');
|
|
echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
|
|
|
|
$date = new DateTime('2010-03-14 03:30:00');
|
|
echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
|
|
?>
|
|
--EXPECT--
|
|
2010-03-14 01:30:00 EST/America/New_York - 1268548200
|
|
2010-03-14 03:00:00 EDT/America/New_York - 1268550000
|
|
2010-03-14 03:30:00 EDT/America/New_York - 1268551800
|
|
2010-03-14 03:00:00 EDT/America/New_York - 1268550000
|
|
2010-03-14 03:30:00 EDT/America/New_York - 1268551800
|