Bug #78478 [Opn->Nab]: DateTime is formatting wrongly
Edit report at https://bugs.php.net/bug.php?id=78478&edit=1
ID: 78478
Updated by: requinix@php.net
Reported by: jmriera at oqpbcn dot com
Summary: DateTime is formatting wrongly
-Status: Open
+Status: Not a bug
Type: Bug
Package: Date/time related
Operating System: Centos
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Today is August 30th. Asking for a date in February 2018 will give you February 30th, 2018. That
overflows into March.
Perhaps you want to use the ! modifier?
Previous Comments:
------------------------------------------------------------------------
[2019-08-30 15:18:27] jmriera at oqpbcn dot com
The following patch has been added/updated:
Patch Name: OQP
Revision: 1567178307
URL: https://bugs.php.net/patch-display.php?bug=78478&patch=OQP&revision=1567178307
------------------------------------------------------------------------
[2019-08-30 15:06:51] jmriera at oqpbcn dot com
Description:
------------
The format method in the date time is formatting wrongly
Test script:
---------------
$do=DateTime::createFromFormat('F-y','February-18');
echo $do->format("Y-m-d H:i:s").'<br>';
The result is outside of the February month
2018-03-02 16:49:08
Expected result:
----------------
2018-02-?? ...
Actual result:
--------------
The result is outside of the February month
2018-03-02 16:49:08
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78478&edit=1
Thread (4 messages)