Bug #69104 [Opn->Nab]: strtotime() Give false seconds in between Mar-Apr && Sep-Oct
Edit report at https://bugs.php.net/bug.php?id=69104&edit=1
ID: 69104
Updated by: rasmus@php.net
Reported by: irfangondal60 at gmail dot com
Summary: strtotime() Give false seconds in between Mar-Apr &&
Sep-Oct
-Status: Open
+Status: Not a bug
Type: Bug
Package: Date/time related
PHP Version: 5.6.6
Block user comment: N
Private report: N
New Comment:
You have discovered DST
Previous Comments:
------------------------------------------------------------------------
[2015-02-22 19:15:06] irfangondal60 at gmail dot com
Description:
------------
$total_seconds = strtotime("2015-04-00 00:00:00") - strtotime("2015-03-00
00:00:00");
This code shows that $total_seconds = 2674800 (This is False)
True answer is 2678400 ($total_seconds + 3600)
And the Same problem is in another month
$total_seconds2 = strtotime("2015-11-00 00:00:00") - strtotime("2015-10-00
00:00:00");
This code shows $total_seconds2 = 2682000 (This is False)
True answer is 2678400 ($total_seconds - 3600)
This problem is in between March-April && Sep-Oct in Many years. Like 2011,2012,2013,2014
etc.
Test script:
---------------
<?php
$total_seconds = strtotime("2015-04-00 00:00:00") - strtotime("2015-03-00
00:00:00");
echo $total_seconds;
echo "<br>";
$total_seconds2 = strtotime("2015-11-00 00:00:00") - strtotime("2015-10-00
00:00:00");
echo $total_seconds2;
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69104&edit=1
Thread (2 messages)