php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80540 Wrong strtotime() result
Submitted: 2020-12-22 08:31 UTC Modified: 2020-12-22 10:38 UTC
From: kekrta500 at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 7.3.25 OS: Debian
Private report: No CVE-ID: None
 [2020-12-22 08:31 UTC] kekrta500 at gmail dot com
Description:
------------
<?php
$start = strtotime('2020-03-08');
$end = strtotime('2020-03-09');
echo (($end - $start) / 24 / 60 / 60);
// https://sandbox.onlinephpfunctions.com/code/fff39352ad15de4414a53383499d02056f53bb22

Test script:
---------------
<?php
$start = strtotime('2020-03-08');
$end = strtotime('2020-03-09');
echo (($end - $start) / 24 / 60 / 60);


Expected result:
----------------
1

Actual result:
--------------
0.95833333333333

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-22 10:38 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Package: Math related +Package: Date/time related
 [2020-12-22 10:38 UTC] requinix@php.net
Congratulations on discovering Daylight Saving Time.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 16:01:29 2024 UTC