Bug #69104 [Opn->Nab]: strtotime() Give false seconds in between Mar-Apr && Sep-Oct

From: Date: Sun, 22 Feb 2015 21:26:29 +0000
Subject: Bug #69104 [Opn->Nab]: strtotime() Give false seconds in between Mar-Apr && Sep-Oct
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190897@lists.php.net to get a copy of this message
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)

« previous php.bugs (#190897) next »