Doc #79304 [NEW]: Doc. for DateTime::createFromFormat/date_create_from_format not consistent

From: Date: Mon, 24 Feb 2020 19:57:21 +0000
Subject: Doc #79304 [NEW]: Doc. for DateTime::createFromFormat/date_create_from_format not consistent
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17334@lists.php.net to get a copy of this message
From:             patrick dot kuijvenhoven at gmail dot com
Operating system: 
PHP version:      Irrelevant
Package:          Documentation problem
Bug Type:         Documentation Problem
Bug description:Doc. for DateTime::createFromFormat/date_create_from_format not consistent

Description:
------------
Reference https://www.php.net/manual/en/datetime.createfromformat.php

Please notice where X and Y are present in each column in the following
table:

+---------------------+------------------------------+-----------------+
| format              | description                  | example        
|
+---------------------+------------------------------+-----------------+
| X and Y             | ...  with (X) or without (Y) | 01 to 31 (X) or
|
| (alphabetical sort) |  leading zeros ...           |  1 to 31 (Y)   
|
+---------------------+------------------------------+-----------------+

This style works for "d and j", "D and l", "m and n".

The time variants "g and h" and "G and H" do not follow this style. 

This can be fixed by replacing "with or without" to "without or with" in
the "description" column for these formats. So, suggested to rewrite
as:

+--------------+-------------------------+--------------------------------+
| format       | description             | example                      
 |
+--------------+-------------------------+--------------------------------+
| g and h      | ... without or with ... | 01 thought 12 or 01 through
12 |
| G and H      | ... without or with ... | 0 thought 23 or 00 through 23
 | 
+--------------+-------------------------+--------------------------------+

Another option could be to explicitly mention the format in the
description, thus like "... without (G) or with (H) ...".



-- 
Edit bug report at https://bugs.php.net/bug.php?id=79304&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=79304&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=79304&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=79304&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=79304&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=79304&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=79304&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=79304&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=79304&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=79304&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=79304&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79304&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=79304&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=79304&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=79304&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=79304&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=79304&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=79304&r=mysqlcfg


Thread (13 messages)

« previous php.doc.bugs (#17334) next »