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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kekrta500 at gmail dot com
New email:
PHP Version: OS:

 

 [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-2021 The PHP Group
All rights reserved.
Last updated: Wed Apr 21 21:01:24 2021 UTC