Bug #75976 [Opn->Nab]: datetime diff has problem in a day in Asia/Tehran Timezone

From: Date: Sat, 17 Feb 2018 15:43:54 +0000
Subject: Bug #75976 [Opn->Nab]: datetime diff has problem in a day in Asia/Tehran Timezone
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214002@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75976&edit=1 ID: 75976 Updated by: requinix@php.net Reported by: armin dot 4838 at gmail dot com Summary: datetime diff has problem in a day in Asia/Tehran Timezone -Status: Open +Status: Not a bug Type: Bug Package: Date/time related Operating System: linux , windows PHP Version: 7.1.14 Block user comment: N Private report: N New Comment: Asia/Tehran begins DST on March 22nd 2018 at midnight. That day will only be 23 hours long. https://www.timeanddate.com/time/change/iran/tehran https://3v4l.org/ISLGP If you construct the dates so that they do not include the skipped time between 00:00 and 01:00 then you will see a full day in the diff. https://3v4l.org/4thuL Previous Comments: ------------------------------------------------------------------------ [2018-02-17 07:57:14] armin dot 4838 at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=75976&edit=1

« previous php.bugs (#214002) next »