Bug #77571 [Com]: DateInterval has incorrect interval using timezones from UTC+01:00 to UTC+12:00
| From: | a at b dot c dot de | Date: | Thu, 07 Feb 2019 01:19:41 +0000 |
| Subject: | Bug #77571 [Com]: DateInterval has incorrect interval using timezones from UTC+01:00 to UTC+12:00 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219397@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77571&edit=1
ID: 77571
Comment by: a at b dot c dot de
Reported by: techouse at gmail dot com
Summary: DateInterval has incorrect interval using timezones
from UTC+01:00 to UTC+12:00
Status: Open
Type: Bug
Package: Date/time related
Operating System: macOS 10.14.3, Ubuntu 18.04
PHP Version: 7.3.1, 7.2.10
Block user comment: N
Private report: N
New Comment:
May also be related to bug #76374
Previous Comments:
------------------------------------------------------------------------
[2019-02-06 08:55:48] techouse at gmail dot com
Might be related to https://bugs.php.net/bug.php?id=52480
------------------------------------------------------------------------
[2019-02-06 08:22:05] techouse at gmail dot com
Better summary
------------------------------------------------------------------------
[2019-02-06 08:20:45] techouse at gmail dot com
Updated the summary to be more descriptive and added another tested PHP version.
------------------------------------------------------------------------
[2019-02-05 15:26:37] techouse at gmail dot com
Description:
------------
Yesterday I observed a weird DateInterval bug where adding 5 weeks would always equal 35 days but
the difference in months and days would not be correct.
After some digging I figured out it was related to timezones and only affected timezones ranging
from Europe/London eastward all the way to Pacific/Auckland, however as soon as I used
Pacific/Honolulu the issue was gone.
Test findings
All the tests in tests/Timezones/America and tests/Timezones/Atlantic pass. Another weird thing is
that Europe/London passes all tests where it does not adhere to daylight savings time (UTC+01:00).
From this I draw a conclusion that all timezones that are greater than UTC+00:00 fail because of
this additional time.
All the tests and findings can be found in my GitHub repo https://github.com/techouse/php-date-interval-timezone-bug
Test script:
---------------
https://github.com/techouse/php-date-interval-timezone-bug
Expected result:
----------------
A correct DateInterval.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77571&edit=1