xref: /PHP-8.2/ext/date/tests/gh9880.phpt (revision d0218511)
1--TEST--
2Bug GH-9880 (DateTime diff returns wrong sign on day count when using a timezone)
3--FILE--
4<?php
5
6ini_set('date.timezone', 'America/Los_Angeles');
7
8$nowTime = new DateTime();
9$nowTime->setTimestamp(1667416695);
10
11$dateTime = new DateTime();
12$dateTime->setTimestamp(1671904800);
13$dateTime->setTimezone(new DateTimeZone('America/New_York'));
14
15echo $dateTime->diff($nowTime)->format('%R %a %H %I %S'), "\n";
16?>
17--EXPECT--
18- 51 22 41 45
19