Bug #75976 [NEW]: datetime diff has problem in a day in Asia/Tehran Timezone

From: Date: Sat, 17 Feb 2018 07:57:16 +0000
Subject: Bug #75976 [NEW]: datetime diff has problem in a day in Asia/Tehran Timezone
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214000@lists.php.net to get a copy of this message
From: armin dot 4838 at gmail dot com Operating system: linux , windows PHP version: 7.1.14 Package: Date/time related Bug Type: Bug Bug description:datetime diff has problem in a day in Asia/Tehran Timezone 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 -- Edit bug report at https://bugs.php.net/bug.php?id=75976&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75976&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75976&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75976&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75976&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75976&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75976&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75976&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75976&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75976&r=support Expected behavior: https://bugs.php.net/fix.php?id=75976&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75976&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75976&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75976&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75976&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75976&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75976&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75976&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75976&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75976&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75976&r=mysqlcfg

« previous php.bugs (#214000) next »