Doc #79939 [Opn]: RFC 822 and 2822 missing from DateTime "Compound Formats"
Edit report at https://bugs.php.net/bug.php?id=79939&edit=1
ID: 79939
User updated by: thomas at landauer dot at
Reported by: thomas at landauer dot at
Summary: RFC 822 and 2822 missing from DateTime "Compound
Formats"
Status: Open
Type: Documentation Problem
Package: Date/time related
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Well, OK, but when a page starts with "This page describes the different compound date/time
formats that the [...] parser understands.", I'd expect that this is a *complete* list of
everything the parser understands.
So you could at least add a note like "Plus all RFC formats mentioned at https://www.php.net/manual/en/class.datetime.php
"
Previous Comments:
------------------------------------------------------------------------
[2020-08-06 18:59:16] requinix@php.net
Because those formats don't need any special handling. They're just regular date strings.
Notice how the other RFCs aren't mentioned either?
------------------------------------------------------------------------
[2020-08-06 12:39:58] thomas at landauer dot at
Description:
------------
Passing an RFC 822 or RFC 2822 formatted DateTime string into the DateTime() constructor works, but
it's not documented at https://www.php.net/manual/datetime.formats.compound.php
However, there are constants for both, and they are mentioned at https://www.php.net/manual/class.datetime.php
Test script:
---------------
// RFC 822:
new DateTime('Mon, 15 Aug 05 15:52:01 +0000');
// RFC 2822:
new DateTime('Mon, 15 Aug 2005 15:52:01 +0000');
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79939&edit=1
Thread (5 messages)