|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-10-30 19:31 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2021-10-30 19:31 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 00:00:01 2025 UTC |
Description: ------------ In PHP Manual ›Supported Date and Time Formats ›Relative Formats number format is [+-]?[0-9]+ , no decimal point included. If number is given with decimal value, number should be cut before decimal point, eg "+1.5" should be read as "+1" Now, it is read as "5" Test script: --------------- <?php // in examples below, this script was run at 30.10.2021 echo date("j.n.Y", strtotime("+1.5 year", time())); echo date("j.n.Y", strtotime("-1.5 year", time())); ?> Expected result: ---------------- 30.10.2022 // 1 year ahead 30.10.2020 // 1 year backwards Actual result: -------------- 30.10.2026 // This is 5 years ahead, not 1.5 years ahead 30.10.2026 // This is 5 years ahead, not 1.5 years backwards