Bug #52480 [Asn->Csd]: Incorrect difference using DateInterval

From: Date: Tue, 06 Apr 2021 19:51:35 +0000
Subject: Bug #52480 [Asn->Csd]: Incorrect difference using DateInterval
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233247@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=52480&edit=1

 ID:                 52480
 Updated by:         derick@php.net
 Reported by:        alex dot joyce at staff dot comcen dot com dot au
 Summary:            Incorrect difference using DateInterval
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Date/time related
 Operating System:   irrelevant
 PHP Version:        7.1
 Assigned To:        derick
 Block user comment: N
 Private report:     N

 New Comment:

The fix for this bug has been committed.
If you are still experiencing this bug, try to check out latest source from https://github.com/php/php-src and re-test.
Thank you for the report, and for helping us make PHP better.

Fixed for PHP 8.1.


Previous Comments:
------------------------------------------------------------------------
[2021-03-20 21:18:39] dolgopolsky dot a at gmail dot com

Still happens for March 1-29 on PHP 7.4

------------------------------------------------------------------------
[2020-07-24 09:33:40] cmb@php.net

Related To: Bug #77969

------------------------------------------------------------------------
[2019-02-06 09:02:05] techouse at gmail dot com

I found something weird using timezones yesterday and reported it here https://bugs.php.net/bug.php?id=77571

Basically the DateInterval reports a wrong interval whenever a timezone between UTC+01:00 and
UTC+12:00 is applied. I wrote a bunch of tests with all kinds of timezones here https://github.com/techouse/php-date-interval-timezone-bug

------------------------------------------------------------------------
[2019-01-28 12:03:55] cz dot paranoiq at gmail dot com

another funny behavior of diff():

```
$start = new DateTime('1922-03-26 00:00:00');
$end = new DateTime('2000-01-02 00:00:00');
echo $end->diff($start, true)->format('%Y years, %m months, %d days, %h hours, %i
minutes, %s seconds');
```

returns some minutes and seconds, although both times are exact midnight. starts to be broken on
this start date or this interval length. breaks with another start time since PHP 7.3.2RC (somewhere
in 1892)

------------------------------------------------------------------------
[2017-05-25 23:27:56] michael dot moussa at gmail dot com

I have submitted a PR with a test case for this bug:

https://github.com/php/php-src/pull/2539

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


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=52480


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


Thread (28 messages)

« previous php.bugs (#233247) next »