php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75714 Date format Day is J but Example 4 use d
Submitted: 2017-12-20 18:53 UTC Modified: 2017-12-20 19:09 UTC
From: nicoesiea at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 7.2.0 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nicoesiea at gmail dot com
New email:
PHP Version: OS:

 

 [2017-12-20 18:53 UTC] nicoesiea at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.date
---
The Date format for day is j, but the doc use d and the result is empty

Expected result:
----------------
$today = date("Y-m-j H:i:s");                   // 2001-03-10

Actual result:
--------------
$today = date("Y-m-d H:i:s");                   // 2001-03-

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-12-20 19:09 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Package: Documentation problem +Package: Date/time related
 [2017-12-20 19:09 UTC] requinix@php.net
...no? 'd' is the day number with leading zeroes (while 'j' does not have leading zeroes) so "Y-m-d" is correct for the example.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 17:01:30 2025 UTC