Bug #74691 [Fbk->Nab]: Novosibirsk Data Time Anomaly
| From: | derick@php.net | Date: | Fri, 02 Jun 2017 11:33:30 +0000 |
| Subject: | Bug #74691 [Fbk->Nab]: Novosibirsk Data Time Anomaly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209362@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74691&edit=1
ID: 74691
Updated by: derick@php.net
Reported by: karpulix at ya dot ru
Summary: Novosibirsk Data Time Anomaly
-Status: Feedback
+Status: Not a bug
Type: Bug
Package: Date/time related
Operating System: All
PHP Version: 7.1.5
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Actually, I see what happens.
There is no bug.
Unlike Moscow and New_York, Novosibirsk changed GMT offsets between June 2nd,2015 and June 2nd,
2017.
Moscow:
Europe/Moscow Sat Mar 26 23:00:00 2011 UT = Sun Mar 27 03:00:00 2011 MSK isdst=0 gmtoff=14400
Europe/Moscow Sat Oct 25 21:59:59 2014 UT = Sun Oct 26 01:59:59 2014 MSK isdst=0 gmtoff=14400
Europe/Moscow Sat Oct 25 22:00:00 2014 UT = Sun Oct 26 01:00:00 2014 MSK isdst=0 gmtoff=10800
(Last change was in 2014 to UTC+3)
New York
UTC+3
Novosibirsk:
Asia/Novosibirsk Sat Mar 26 20:00:00 2011 UT = Sun Mar 27 03:00:00 2011 +07 isdst=0 gmtoff=25200
Asia/Novosibirsk Sat Oct 25 18:59:59 2014 UT = Sun Oct 26 01:59:59 2014 +07 isdst=0 gmtoff=25200
Asia/Novosibirsk Sat Oct 25 19:00:00 2014 UT = Sun Oct 26 01:00:00 2014 +06 isdst=0 gmtoff=21600
Asia/Novosibirsk Sat Jul 23 19:59:59 2016 UT = Sun Jul 24 01:59:59 2016 +06 isdst=0 gmtoff=21600
Asia/Novosibirsk Sat Jul 23 20:00:00 2016 UT = Sun Jul 24 03:00:00 2016 +07 isdst=0 gmtoff=25200
UTC+6 in 2015, and UTC+7 in 2017. That's why you get the 3600 seconds difference.
Previous Comments:
------------------------------------------------------------------------
[2017-06-02 11:29:10] derick@php.net
Can you add the Actual and Expected output please?
------------------------------------------------------------------------
[2017-06-02 11:20:34] karpulix at ya dot ru
Description:
------------
Incorrect time interval in the Novosibirsk time zone. The problem is easy to reproduce on any server
----------------------
ÐекоÑÑекÑнÑй инÑеÑвал
вÑемени ÐовоÑибиÑÑком
ÑаÑовом поÑÑе. ÐÑоблемÑ
легко воÑпÑоизвеÑÑи на
лÑбом ÑеÑвеÑе
Test script:
---------------
$datetime_start = new DateTime('02.06.2015',new DateTimeZone("Europe/Moscow"));
$datetime_end = new DateTime('02.06.2017',new DateTimeZone("Europe/Moscow"));
print_r($datetime_end->getTimestamp() - $datetime_start->getTimestamp());
echo PHP_EOL;
$datetime_start = new DateTime('02.06.2015',new
DateTimeZone("America/New_York"));
$datetime_end = new DateTime('02.06.2017',new DateTimeZone("America/New_York"));
print_r($datetime_end->getTimestamp() - $datetime_start->getTimestamp());
echo PHP_EOL;
$datetime_start = new DateTime('02.06.2015',new
DateTimeZone("Asia/Novosibirsk"));
$datetime_end = new DateTime('02.06.2017',new DateTimeZone("Asia/Novosibirsk"));
print_r($datetime_end->getTimestamp() - $datetime_start->getTimestamp());
echo PHP_EOL;
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74691&edit=1