|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-04-05 11:32 UTC] derick@php.net
-Summary: DateTime::sub dosnt work
+Summary: DateTime::sub doesn't work
-Status: Open
+Status: Not a bug
[2017-04-05 11:32 UTC] derick@php.net
[2017-04-05 11:48 UTC] requinix@php.net
-Status: Not a bug
+Status: Duplicate
[2017-04-05 11:48 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 14:00:01 2025 UTC |
Description: ------------ --- Its work with date '2011-03-27 03:59:59' --- Test script: --------------- $d = new DateTime('2011-03-27 03:59:59'); var_dump(['$d is' => $d]); $d_new = $d->sub(new DateInterval('PT1H')); var_dump(['$d_new is' => $d_new]); Expected result: ---------------- array (size=1) '$d_new is' => object(DateTime)[1] public 'date' => string '2011-03-27 02:59:59.000000' (length=26) public 'timezone_type' => int 3 public 'timezone' => string 'Europe/Moscow' (length=13) Actual result: -------------- array (size=1) '$d_new is' => object(DateTime)[1] public 'date' => string '2011-03-27 03:59:59.000000' (length=26) public 'timezone_type' => int 3 public 'timezone' => string 'Europe/Moscow' (length=13)