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

From: Date: Sun, 22 Feb 2015 19:15:06 +0000
Subject: Bug #69104 [NEW]: strtotime() Give false seconds in between Mar-Apr && Sep-Oct
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190893@lists.php.net to get a copy of this message
From:             irfangondal60 at gmail dot com
Operating system: 
PHP version:      5.6.6
Package:          Date/time related
Bug Type:         Bug
Bug description:strtotime() Give false seconds in between Mar-Apr && Sep-Oct

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 bug report at https://bugs.php.net/bug.php?id=69104&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=69104&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=69104&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=69104&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=69104&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=69104&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=69104&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=69104&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=69104&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=69104&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=69104&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=69104&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=69104&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=69104&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69104&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=69104&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=69104&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=69104&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69104&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=69104&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=69104&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#190893) next »