php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dv at josheli dot com
New email:
PHP Version: OS:

 

 [2004-01-06 23:39 UTC] dv at josheli dot com
Description:
------------
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
    ^^

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

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] eru@php.net
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