|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-11-02 22:47 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2020-11-02 22:47 UTC] requinix@php.net
[2020-11-02 22:56 UTC] bruno at leveque dot io
[2020-11-02 23:17 UTC] requinix@php.net
[2020-11-03 01:09 UTC] safa_al18 at hotmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 23:00:01 2025 UTC |
Description: ------------ strtotime() is encountering issues when dealing with Nov 1st, 2020 specifically. - Adding 2 x 86400 seconds to Nov 1st will actually return Nov 2nd - Adding '+2 days' to the same date returns Nov 3rd This issue does not happen with any other date. Test script: --------------- <?php /* Add 2 days to Oct 1st ** Outputs 2020-10-03 - Correct */ echo strftime('%Y-%m-%d', strtotime('2020-10-01') + (2 * 86400))."\n"; /* Add 2 days to Nov 1st ** Outputs 2020-11-02 - Bug */ echo strftime('%Y-%m-%d', strtotime('2020-11-01') + (2 * 86400))."\n"; /* Add 2 days to Nov 1st ** Outputs 2020-11-03 - Correct */ echo strftime('%Y-%m-%d', strtotime('2020-11-01 + 2 days'))."\n"; Expected result: ---------------- 2020-10-03 2020-11-03 2020-11-03 Actual result: -------------- 2020-10-03 2020-11-02 2020-11-03