Bug #78478 [Nab]: DateTime is formatting wrongly

From: Date: Mon, 02 Sep 2019 07:24:36 +0000
Subject: Bug #78478 [Nab]: DateTime is formatting wrongly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222516@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78478&edit=1 ID: 78478 User updated by: jmriera at oqpbcn dot com Reported by: jmriera at oqpbcn dot com Summary: DateTime is formatting wrongly 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: Ok I understand. Previous Comments: ------------------------------------------------------------------------ [2019-08-30 15:26:14] requinix@php.net 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? ------------------------------------------------------------------------ [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

« previous php.bugs (#222516) next »