Bug #76125 [Com]: error date_create_from_format

From: Date: Wed, 21 Mar 2018 13:58:29 +0000
Subject: Bug #76125 [Com]: error date_create_from_format
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214435@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
 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


Thread (1 message)

  • spam2 at rhsoft dot net
  • Unknown Message
    • spam2 at rhsoft dot net
« previous php.bugs (#214435) next »