php.net |  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: Closed Package: Date/time related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: thomas at landauer dot at
New email:
PHP Version: OS:

 

 [2020-08-06 12:39 UTC] 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');


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-06 18:59 UTC] 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 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 https://www.php.net/manual/en/class.datetime.php "
 [2020-08-06 19:30 UTC] requinix@php.net
That's basically what I was thinking too.
 [2022-06-02 17:30 UTC] git@php.net
Automatic comment on behalf of derickr
Revision: https://github.com/php/doc-en/commit/48e99212ad659f3aa5e0202e0194f9f13612c024
Log: Fixed bug #79939: RFC 822 and 2822 missing from DateTime 'Compound Formats'
 [2022-06-02 17:30 UTC] git@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 21:01:28 2024 UTC