|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26822 Extra space in date('r')
Submitted: 2004-01-06 23:39 UTC Modified: 2004-01-07 02:58 UTC
From: dv at josheli dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5CVS, 4CVS OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dv at josheli dot com
New email:
PHP Version: OS:


 [2004-01-06 23:39 UTC] dv at josheli dot com
date('r') on windows puts an extra space in the formatted result.

found on 4.3.4, php5 beta2, php5-win32-200401070330 snap

Reproduce code:
php -r "echo date('r');"

Expected result:
Tue, 6 Jan 2004 22:26:00 -0600

Actual result:
Tue,  6 Jan 2004 22:26:00 -0600


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-07 01:35 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

php -r \"echo date(\'r\', mktime(0, 0, 0, 1, 10, 2004));\"

 [2004-01-07 02:23 UTC] dv at josheli dot com
Okay, thanks for your time.

But I don't quite follow. i don't see anything in the manual that states your solution.

php -r "echo date('r', mktime(0, 0, 0, 1, 10, 2004));"
seems to be a workaround.

the manual says "timestamp is optional", the 'r' format character claims an "RFC 822 formatted date", and nowhere in RFC 822 does it show that extra space.
 [2004-01-07 02:58 UTC]
The line php -r "echo date('r', mktime(0, 0, 0, 1, 10, 2004));" just shows, that there is only one space between "," and "10", so the two spaces in case of a one-digit daynumber is just for format.

Btw. 822 was obsoleted by 2822, as you might've noticed, that 4-digit years are not allowed by 822.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 16:01:29 2024 UTC