Doc #67793 [Opn->Nab]: DateTime DD MM
| From: | aharvey@php.net | Date: | Wed, 06 Aug 2014 05:39:00 +0000 |
| Subject: | Doc #67793 [Opn->Nab]: DateTime DD MM | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-11414@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67793&edit=1
ID: 67793
Updated by: aharvey@php.net
Reported by: mr-yellow at mr-yellow dot com
Summary: DateTime DD MM
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: Date/time related
PHP Version: 5.4.31
Block user comment: N
Private report: N
New Comment:
Those are input formats only; the format strings you can provide to DateTime::format() and date()
are documented at http://php.net/date.
Previous Comments:
------------------------------------------------------------------------
[2014-08-06 05:33:45] mr-yellow at mr-yellow dot com
Description:
------------
---
From manual page: http://www.php.net/datetime.formats.date
---
Following the conventions on this page, DateTime responds differently.
$created = \DateTime::createFromFormat('U',$created);
$created = $created->format('DD/MM/YY');
WedWed/AugAug/20142014
Test script:
---------------
$created = \DateTime::createFromFormat('U',1407297720);
$created = $created->format('DD/MM/YY');
echo $created;
Expected result:
----------------
06/08/2014
Actual result:
--------------
WedWed/AugAug/20142014
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67793&edit=1