|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79939 RFC 822 and 2822 missing from DateTime "Compound Formats"
Submitted: 2020-08-06 12:39 UTC Modified: 2020-08-06 19:30 UTC
From: thomas at landauer dot at Assigned:
Status: Open Package: Date/time related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-08-06 12:39 UTC] thomas at landauer dot at
Passing an RFC 822 or RFC 2822 formatted DateTime string into the DateTime() constructor works, but it's not documented at

However, there are constants for both, and they are mentioned at

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');


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-06 18:59 UTC]
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 19:15 UTC] thomas at landauer dot at
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 "
 [2020-08-06 19:30 UTC]
That's basically what I was thinking too.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Aug 01 11:01:24 2021 UTC