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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Sun Dec 22 01:01:30 2024 UTC