Skip to content

Commit

Permalink
Fixed bug #81565 (date parsing fails when provided with timezones inc…
Browse files Browse the repository at this point in the history
…luding seconds)
  • Loading branch information
derickr committed May 20, 2022
1 parent 78d5076 commit 008016b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ PHP NEWS
format - YYYY-MM-DDTHH) (cmb, Derick)
. Fixed bug #68549 (Timezones and offsets are not properly used when working
with dates) (Derick, Roel Harbers)
. Fixed bug #81565 (date parsing fails when provided with timezones including
seconds). (Derick)
. Fixed bug GH-7758 (Problems with negative timestamps and fractions).
(Derick, Ilija)

Expand Down
20 changes: 20 additions & 0 deletions ext/date/tests/bug81565.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--TEST--
Bug #81565 (date parsing fails when provided with timezones including seconds)
--FILE--
<?php
var_export(
\DateTime::createFromFormat(
'Y-m-d H:i:sO',
'0021-08-21 00:00:00+00:49:56'
)
);

echo "\n", (new DatetimeZone('+01:45:30'))->getName();
?>
--EXPECT--
DateTime::__set_state(array(
'date' => '0021-08-21 00:00:00.000000',
'timezone_type' => 1,
'timezone' => '+00:49',
))
+01:45

0 comments on commit 008016b

Please sign in to comment.