Bug #74524 [Com]: Date diff is bad calculated, in same time zone

From: Date: Mon, 30 Oct 2017 11:26:12 +0000
Subject: Bug #74524 [Com]: Date diff is bad calculated, in same time zone
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212372@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74524&edit=1

 ID:                 74524
 Comment by:         onda204 at gmail dot com
 Reported by:        kalita dot michal at gmail dot com
 Summary:            Date diff is bad calculated, in same time zone
 Status:             Open
 Type:               Bug
 Package:            Date/time related
 Operating System:   Linux
 PHP Version:        7.1.4
 Block user comment: N
 Private report:     N

 New Comment:

Hi,
I detected the following issue that may have to do with present Bug.
Using diff with dates that are on range of summer / winter time change, the function diff on element
$interval->h gives result -1

Tested width date interval:
27-10-2017
15.00 H

29-10-2017
14.00 H

Portuguese regional settings


Previous Comments:
------------------------------------------------------------------------
[2017-05-06 19:02:46] heiglandreas@php.net

This is a DST issue as can be seen in https://3v4l.org/9AWOI

The default Timezone of 3v4l.org is Europe/Amsterdam which has DST and therefore has the issue!

------------------------------------------------------------------------
[2017-05-03 07:18:55] andrew dot nester dot dev at gmail dot com

Just added reworked pull request to this issue. Here is the link https://github.com/php/php-src/pull/2506

------------------------------------------------------------------------
[2017-05-02 20:06:40] andrew dot nester dot dev at gmail dot com

Thanks Derick!
gonna rework my pull request

------------------------------------------------------------------------
[2017-05-02 12:33:58] derick@php.net

Andrew, it might look fixed for you because you have a different timezone with different DST rules
configured.

------------------------------------------------------------------------
[2017-05-02 12:22:20] andrew dot nester dot dev at gmail dot com

thanks for reporting the issue!
I've been trying to reproduce it on latest PHP7.1 version (7.1.6-dev) and seems it's fixed
already.
Anyway, I've added test to check that it works (see my PR)

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=74524


--
Edit this bug report at https://bugs.php.net/bug.php?id=74524&edit=1


Thread (10 messages)

« previous php.bugs (#212372) next »