php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69104 strtotime() Give false seconds in between Mar-Apr && Sep-Oct
Submitted: 2015-02-22 19:15 UTC Modified: 2015-02-22 21:26 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: irfangondal60 at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.6.6 OS:
Private report: No CVE-ID: None
 [2015-02-22 19:15 UTC] 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;
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-02-22 21:26 UTC] rasmus@php.net
-Status: Open +Status: Not a bug
 [2015-02-22 21:26 UTC] rasmus@php.net
You have discovered DST
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 25 00:01:31 2024 UTC