php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76926 The date constant format is different. DATE_RFC1123 
Submitted: 2018-09-24 02:10 UTC Modified: 2018-11-18 22:37 UTC
From: no-reply at example dot com Assigned:
Status: No Feedback Package: Documentation problem
PHP Version: 7.3.0RC1 OS:
Private report: No CVE-ID: None
 [2018-09-24 02:10 UTC] no-reply at example dot com
Description:
------------
DATE_RFC1123
The date constant format is different.


Reference material for RFC1123.
https://docs.microsoft.com/en-us/dotnet/api/system.globalization.datetimeformatinfo.rfc1123pattern?view=netframework-4.7.2



Test script:
---------------
php -r "echo gmdate(DATE_RFC1123, gmmktime(0,0,0,1,1,2018));"

Expected result:
----------------
Mon, 01 Jan 2018 00:00:00 GMT


Actual result:
--------------
Mon, 01 Jan 2018 00:00:00 +0000


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-09-24 02:29 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2018-09-24 02:29 UTC] requinix@php.net
You know we aren't Microsoft, right?

The actual RFC 1123 says
> There is a strong trend towards the use of numeric timezone
> indicators, and implementations SHOULD use numeric timezones
> instead of timezone names.
https://tools.ietf.org/html/rfc1123

And the standard there is basically just a slight adjustment to RFC 822's which describes the timezone as
> zone = ... / ( ("+" / "-") 4DIGIT ) ; Local differential hours+min. (HHMM)
https://tools.ietf.org/html/rfc822

And the actual output from PHP matches what the documentation describes. So I don't know what bug you're reporting.

If anything it's .NET that's difficult because the format string clearly outputs "GMT" as the timezone, which is alluded to in the general date/time formatting docs:
> Although the RFC 1123 standard expresses a time as Coordinated Universal Time (UTC), the formatting operation
> does not modify the value of the DateTime object that is being formatted. Therefore, you must convert the
> DateTime value to UTC by calling the DateTime.ToUniversalTime method before you perform the formatting
> operation.
https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings#RFC1123
 [2018-09-26 01:02 UTC] no-reply at example dot com
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString

dateObj.toUTCString()
The most common return value was an RFC-1123 formatted date stamp
 [2018-09-26 01:15 UTC] no-reply at example dot com
<!DOCTYPE html>
<html><head><meta charset="UTF-8"></head>
<body><script>
alert('RFC-1123 formatted date stamp is ' + (new Date).toUTCString())
</script>
</html>
 [2018-09-26 01:16 UTC] requinix@php.net
And?

Use your words. Full sentences.
 [2018-09-26 01:28 UTC] requinix@php.net
If you aren't comfortable writing English then use your native language. Either way, speak, don't link.
 [2018-11-18 22:37 UTC] cmb@php.net
-Status: Feedback +Status: No Feedback
 [2018-11-18 22:37 UTC] cmb@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC