|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-02-17 15:43 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2018-02-17 15:43 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 18 15:00:01 2025 UTC |
Description: ------------ datetime diff return wrong result in date (2018-3-22 - 2018-3-23). it return 23 hours. in my test this problem is in Asia/Tehran Timezone. i test several years and all years in this date has same problem except (2000). also i test in php versions 5.6 and 7.1 Test script: --------------- $dateStart = new DateTime('2018-3-22'); $dateEnd = new DateTime('2018-3-23'); $diff = $dateStart->diff($dateEnd); echo $diff->format("%a Day and %h hours %i minutes %s seconds"); Expected result: ---------------- 1 Day and 0 hours 0 minutes 0 seconds Actual result: -------------- 0 Day and 23 hours 0 minutes 0 seconds