php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66157 Reduce number of date formats from 9 to 1
Submitted: 2013-11-23 06:26 UTC Modified: 2017-10-24 08:10 UTC
Votes:3
Avg. Score:2.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: t at tcx dot de Assigned:
Status: Open Package: Website problem
PHP Version: Irrelevant 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: t at tcx dot de
New email:
PHP Version: OS:

 

 [2013-11-23 06:26 UTC] t at tcx dot de
Description:
------------
Format strings taken from:
http:// us1.php.net/manual/en/function.date.php 

http:// www.php.net/ : "Y-m-d" (fine) (Total = 1)

http:// www.php.net/downloads.php "Y-m-d" + "d M Y" (Total = 2)

http:// www.php.net/ChangeLog-5.php "d-M-Y" (Total = 3)

http:// www.php.net/archive/2013.php#id2013-10-10-1 in URL "Y-m-d", in page "d-M-Y"


(I removed the rest. The Bug reporting system didn't accept the full list.)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-11-23 06:30 UTC] t at tcx dot de
http://us3.php.net/migration55 '5 months ago' - no explicit date, nice to have, but please add explicit data so people can talk about the entry from day XY

http://us3.php.net/download-docs.php "d-M-Y"

http://www.php.net/archive/2013.php#id2013-10-10-1 in URL "Y-m-d", in page "d-M-Y"

http://talks.php.net/index.php/PHP+5 "M d, Y" (Total = 4)

(I removed the rest. Bug reporting system said "Please do not SPAM our bug system." Are PHP sources SPAM?)
 [2013-11-23 06:32 UTC] t at tcx dot de
http://news.php.net/php.announce "D M  j H:i:s Y", the second space before the j only occurs for j<10. The format cannot be expressed with the php formatting codes. (Total = 5)

https://git.php.net/ '18 hours ago' - no explicit date

https://git.php.net/?p=web/gtk.git;a=summary "Y-m-d" + "D, j M Y H:i:s O (H:i O)" , where the second H, i, O differ from the first (Total = 6)

http://news.php.net/group.php?group=php.announce&format=rss "D, d M Y H:i:s O" (Total = 7)

http://pear.php.net/ "D, jS M y" (Total = 8)
 [2013-11-23 06:34 UTC] t at tcx dot de
http://pear.php.net/package/HTTP_OAuth/ "Y-m-d" (fine)

http://pear.php.net/package/Auth/download/ "Y-m-d H:i" (fine)

http://pear.php.net/bugs/search.php?cmd=display&package_name%5B%5D=Auth "Y-m-d" (fine)

http://pear.php.net/manual/en/about-pear.php "D, j M Y" or "D, d M Y" only two digit example found, so format not clear.
 [2013-11-23 06:34 UTC] t at tcx dot de
http://pecl.php.net/ "Y-m-d" (fine)

http://pecl.php.net/news/ "Y-m-d" (fine)

http://pecl.php.net/package/stats "Y-m-d" (fine)

http://marc.info/?l=pecl-dev "Y-m-d" (fine)

http://snaps.php.net/ "M j, Y H:i" or "M d, Y H:i" only two digit example found, so format not clear.  (Total = 9)
 [2013-11-23 18:10 UTC] bjori@php.net
(It thinks it is spam becomes there are so many links :))

Thanks for the report, you raise an excellent point!
 [2014-03-04 04:27 UTC] levim@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: levim
 [2014-03-04 04:27 UTC] levim@php.net
This many date formats in use bothers me as well. I'll look into pruning them a bit.
 [2014-03-04 09:44 UTC] t at tcx dot de
http://www.python.org/ now uses Y-m-d. 

In Gmail web interface I also see that more of my reply emails write something like: "2014-03-04 2:58 GMT+01:00 Name <name@example.org>:" (Note, they miss the leading 0 for one digit hours and use GMT which is wrong, correct is UTC).
 [2014-03-14 15:07 UTC] levim@php.net
Human readable dates will be displayed as 'd M Y'. Datetimes intended for tools will use RFC 3339 (W3C is the same thing). Dates intended for tools (no timestamp information) will use 'Y-m-d'.

I have committed some changes already and plan to work on this today during stretches where my code is compiling.
 [2014-03-14 15:18 UTC] t at tcx dot de
"Human readable dates will be displayed as 'd M Y'. Datetimes intended for tools will use RFC 3339 (W3C is the same thing). Dates intended for tools (no timestamp information) will use 'Y-m-d'."

That again is three formats. On a website all displayed date information can be read by humans. Y-m-d is perfectly readable by humans - at least me and probably the designers of https://www.python.org/ thought so. Y-m-d is defined in ISO 8601 and it is the most compact format of those that are not ambiguous. Straight forward. No RFCs with their handful of formats, no W3C (they themselves don't use it strictly on their site), just one ISO.
 [2014-03-14 15:21 UTC] t at tcx dot de
Y-m-d is already the most used format on php.net when looking at the links provided on creation of this bug.

Just convert the others to Y-m-d and you are done.
 [2014-03-14 15:52 UTC] levim@php.net
> That again is three formats.

Don't be an arse; going from 9 formats to 3 formats is a significant improvement. It's technically only 2 formats as the third is included in the second; I was just being explicit that some things don't have an associated time.
 [2014-03-29 17:56 UTC] t at tcx dot de
@levim's "Don't be an arse;" 

ISO 8601 was not my invention.
 
Here is another source that references it https://xkcd.com/1179/
 [2017-10-24 08:10 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: levim +Assigned To:
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 13:01:24 2019 UTC