Bug #81273 [Asn->Csd]: Date interval calculation not correct

From: Date: Sun, 08 Aug 2021 12:43:09 +0000
Subject: Bug #81273 [Asn->Csd]: Date interval calculation not correct
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235682@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81273&edit=1

 ID:                 81273
 Updated by:         derick@php.net
 Reported by:        alex dot a dot pott at gmail dot com
 Summary:            Date interval calculation not correct
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Date/time related
 Operating System:   OS X
 PHP Version:        8.1Git-2021-07-19 (Git)
 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.

For 8.1.0beta3


Previous Comments:
------------------------------------------------------------------------
[2021-08-08 11:20:43] derick@php.net

@ramsey: none of these are related, only the one by mail at gh01 dot de

------------------------------------------------------------------------
[2021-08-04 08:07:04] mail at gh01 dot de

This one also: https://bugs.php.net/bug.php?id=81263

------------------------------------------------------------------------
[2021-08-03 12:42:21] ramsey@php.net

All of these seem related:

- https://bugs.php.net/bug.php?id=80963
- https://bugs.php.net/bug.php?id=81287
- https://bugs.php.net/bug.php?id=80998

------------------------------------------------------------------------
[2021-07-23 10:57:50] antonino dot spampinato86 at gmail dot com

Although not related to your problem but to +1 month of php 8.1 (must take the above behavior or
change the datetime arithmetic page).

https://3v4l.org/k2gS6

------------------------------------------------------------------------
[2021-07-19 07:23:56] alex dot a dot pott at gmail dot com

Description:
------------
Date interval calculation is has changed in 8.1 and the new calculation is incorrect.

8.0: https://3v4l.org/8g4NB#v8.0.8
8.1: https://3v4l.org/8g4NB/rfc#vgit.master

This seems similar to https://bugs.php.net/bug.php?id=80998

Test script:
---------------
<?php

$time = '2000-01-01 00:00:00.000000';
$tz_aus = new DateTimeZone('Australia/Sydney');
$tz_us = new DateTimeZone('America/Los_Angeles');
$auz = new DateTime($time, $tz_aus);
$us = new DateTime($time, $tz_us);

$diff = $auz->diff($us);
// Should output int(19)
var_dump($diff->h);

Expected result:
----------------
It should output:
int(19)

Actual result:
--------------
int(0)


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



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


Thread (6 messages)

« previous php.bugs (#235682) next »