Bug #76125 [Opn]: error date_create_from_format

From: Date: Wed, 21 Mar 2018 13:00:06 +0000
Subject: Bug #76125 [Opn]: error date_create_from_format
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214428@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76125&edit=1 ID: 76125 Updated by: cmb@php.net Reported by: denorian at yandex dot ru Summary: error date_create_from_format Status: Open Type: Bug -Package: date_time +Package: Date/time related Operating System: linux PHP Version: 7.0.28 Block user comment: N Private report: N New Comment: > //result 2018-03-27 27? Why? Since there is no Tue, 21 Mar 2018, the parser apparently assumes you've meant Tue, 27 Mar 2018 01:38:22 GMT. Previous Comments: ------------------------------------------------------------------------ [2018-03-21 12:21:08] denorian at yandex dot ru Description: ------------ Error in reading the date in the function date_create_from_format Test script: --------------- <? $date = date_create_from_format("D, d M Y H:i:s O", "Tue, 20 Mar 2018 01:38:22 GMT"); echo date_format($date, 'Y-m-d'); //result 2018-03-20 $date = date_create_from_format("D, d M Y H:i:s O", "Tue, 21 Mar 2018 01:38:22 GMT"); echo date_format($date, 'Y-m-d'); //result 2018-03-27 27? Why? ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76125&edit=1

« previous php.bugs (#214428) next »