Skip to content

Commit 64f5f53

Browse files
committed
Merge remote-tracking branch 'derickr/timelib-2021.18' into PHP-8.1
2 parents 44377c3 + d021851 commit 64f5f53

13 files changed

+199
-113
lines changed

NEWS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ PHP NEWS
1010
. Fixed bug GH-9650 (Can't initialize heap: [0x000001e7]). (Michael Voříšek)
1111
. Fixed potentially undefined behavior in Windows ftok(3) emulation. (cmb)
1212

13+
- Date:
14+
. Fixed bug GH-9699 (DateTimeImmutable::diff differences in 8.1.10 onwards -
15+
timezone related). (Derick)
16+
. Fixed bug GH-9700 (DateTime::createFromFormat: Parsing TZID string is too
17+
greedy). (Derick)
18+
. Fixed bug GH-9866 (Time zone bug with \DateTimeInterface::diff()). (Derick)
19+
. Fixed bug GH-9880 (DateTime diff returns wrong sign on day count when using
20+
a timezone). (Derick)
21+
1322
- FPM:
1423
. Fixed bug GH-9959 (Solaris port event mechanism is still broken after bug
1524
#66694). (Petr Sumbera)

ext/date/lib/interval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static void sort_old_to_new(timelib_time **one, timelib_time **two, timelib_rel_
6262
if (
6363
(*one)->zone_type == TIMELIB_ZONETYPE_ID &&
6464
(*two)->zone_type == TIMELIB_ZONETYPE_ID &&
65-
(strcmp((*one)->tz_info->name, (*two)->tz_info->name) != 0)
65+
(strcmp((*one)->tz_info->name, (*two)->tz_info->name) == 0)
6666
) {
6767
if (
6868
((*one)->y > (*two)->y) ||
@@ -200,7 +200,7 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
200200
{
201201
timelib_rel_time *rt;
202202

203-
if (one->zone_type == TIMELIB_ZONETYPE_ID && two->zone_type == TIMELIB_ZONETYPE_ID) {
203+
if (one->zone_type == TIMELIB_ZONETYPE_ID && two->zone_type == TIMELIB_ZONETYPE_ID && strcmp(one->tz_info->name, two->tz_info->name) == 0) {
204204
return timelib_diff_with_tzid(one, two);
205205
}
206206

0 commit comments

Comments
 (0)