Skip to content

Commit 008016b

Browse files
committed
Fixed bug #81565 (date parsing fails when provided with timezones including seconds)
1 parent 78d5076 commit 008016b

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ PHP NEWS
1313
format - YYYY-MM-DDTHH) (cmb, Derick)
1414
. Fixed bug #68549 (Timezones and offsets are not properly used when working
1515
with dates) (Derick, Roel Harbers)
16+
. Fixed bug #81565 (date parsing fails when provided with timezones including
17+
seconds). (Derick)
1618
. Fixed bug GH-7758 (Problems with negative timestamps and fractions).
1719
(Derick, Ilija)
1820

ext/date/tests/bug81565.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Bug #81565 (date parsing fails when provided with timezones including seconds)
3+
--FILE--
4+
<?php
5+
var_export(
6+
\DateTime::createFromFormat(
7+
'Y-m-d H:i:sO',
8+
'0021-08-21 00:00:00+00:49:56'
9+
)
10+
);
11+
12+
echo "\n", (new DatetimeZone('+01:45:30'))->getName();
13+
?>
14+
--EXPECT--
15+
DateTime::__set_state(array(
16+
'date' => '0021-08-21 00:00:00.000000',
17+
'timezone_type' => 1,
18+
'timezone' => '+00:49',
19+
))
20+
+01:45

0 commit comments

Comments
 (0)