|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #74080 Provide an RFC7231 date time format
Submitted: 2017-02-10 19:27 UTC Modified: 2017-02-11 18:44 UTC
From: neclimdul at gmail dot com Assigned:
Status: Closed Package: Date/time related
PHP Version: 7.1.1 OS:
Private report: No CVE-ID: None
 [2017-02-10 19:27 UTC] neclimdul at gmail dot com
There are a number of useful constants for formatting dates in PHP which cover most of the formats used on the internet. Unfortunately there is one missing format which can be pretty important, the one defined by RFC2616. 

All HTTP headers should follow this format. Because its a subset of RFC1123 that format is commonly substituted in PHP. This generally will work with permissive systems, however because the format provided by RFC1123 is system dependent it can provide strings that with more strict proxies will fail to parse. Generally that is UTC instead of the required GMT timezone. And old documentation comment mentions this as well

Because of this Drupal has a custom constant to be used in headers

However because of PHP's audience I think it would be a handy feature for everyone to have the additional format constant.

RFC2616 is actually obsoleeted by RFC7231 in 2014 so I would use this name as Drupal did but the format is the same.


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-02-10 19:28 UTC] neclimdul at gmail dot com
Apologies if this was already submitted somewhere. I thought I had but I searched all over and couldn't find it.
 [2017-02-11 18:44 UTC]
-Type: Bug +Type: Feature/Change Request -Package: *General Issues +Package: Date/time related
 [2017-04-17 07:10 UTC]
Automatic comment on behalf of
Log: Fixed bug #74080 Add datetime constant for RFC7231
 [2017-04-17 07:10 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 20:01:29 2024 UTC