Edit report at https://bugs.php.net/bug.php?id=76125&edit=1
ID: 76125
Comment by: spam2 at rhsoft dot net
Reported by: denorian at yandex dot ru
Summary: error date_create_from_format
Status: Open
Type: Bug
Package: Date/time related
Operating System: linux
PHP Version: 7.0.28
Block user comment: N
Private report: N
New Comment:
the parser should throw a warning
[builduser@testserver:/rpmbuild/SPECS]$ rpmlint fsync-tester.spec
fsync-tester.spec: E: specfile-error warning: bogus date in %changelog: Wed Feb 22 2018
because Wed is wrong, it was a tuesday
Previous Comments:
------------------------------------------------------------------------
[2018-03-21 13:00:05] cmb@php.net
> //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.
------------------------------------------------------------------------
[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