Bug #66187 [NEW]: DateTime->add() incorrect on BST boundry
| From: | andrewpate08 at hotmail dot com | Date: | Wed, 27 Nov 2013 23:01:39 +0000 |
| Subject: | Bug #66187 [NEW]: DateTime->add() incorrect on BST boundry | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-182976@lists.php.net to get a copy of this message | ||
From: andrewpate08 at hotmail dot com
Operating system: Linux/Windows XP
PHP version: Irrelevant
Package: Date/time related
Bug Type: Bug
Bug description:DateTime->add() incorrect on BST boundry
Description:
------------
British summertime does not actually end until....
27-10-2013 01:59:59+01:00 (BST)
at which point, one second later it kicks back to GMT...
27-10-2013 01:00:00+00:00 (GMT)
It seems calculations involving DateTime->add() and the 'Europe/London'
DateTimeZone crossing the END of British summertime (BST) gives an
incorrect result.
On the day British summertime ends it is not until 2:00AM (BST) which is
1:00AM (GMT) that clocks switch from BST to GMT (i.e. go back from 2:00
to 1:00)
Test script:
---------------
<?php
$start = new DateTime("2013-10-27 00:55:00", new
DateTimeZone('Europe/London'));
$step = DateInterval::createFromDateString("600 seconds");
echo "start = " . $start->format('d-m-Y H:i:sP') . "<br />";
$start->add($step);
echo "start = " . $start->format('d-m-Y H:i:sP') . "<br />";
?>
Expected result:
----------------
start = 27-10-2013 00:55:00+01:00
start = 27-10-2013 01:05:00+00:00
Actual result:
--------------
start = 27-10-2013 00:55:00+01:00
start = 27-10-2013 01:05:00+01:00
--
Edit bug report at https://bugs.php.net/bug.php?id=66187&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66187&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66187&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66187&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66187&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66187&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66187&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66187&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66187&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66187&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66187&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66187&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66187&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66187&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66187&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66187&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66187&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66187&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66187&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66187&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66187&r=mysqlcfg