Bug #77144 [Csd->Nab]: strtotime date week conversion
| From: | cmb@php.net | Date: | Tue, 13 Nov 2018 09:56:36 +0000 |
| Subject: | Bug #77144 [Csd->Nab]: strtotime date week conversion | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-217924@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77144&edit=1
ID: 77144
Updated by: cmb@php.net
Reported by: frank dot hartmann at netfira dot com
Summary: strtotime date week conversion
-Status: Closed
+Status: Not a bug
Type: Bug
Package: Date/time related
Operating System: Windows Server 2016
PHP Version: 7.2.12
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2018-11-13 09:05:04] frank dot hartmann at netfira dot com
using "o" as a parameter in date does the trick and yields expected results
------------------------------------------------------------------------
[2018-11-13 08:52:27] frank dot hartmann at netfira dot com
Description:
------------
The 31st of December 2018 is converted to the first week of 2018 instead of the first week of 2019
when using a combination of strototime and date.
Test script:
---------------
echo date("W-Y", strtotime("2018-12-31T00:00:00Z"))."\n"; //outputs
01-2018 instead of 01-2019
echo date("d-m-Y", strtotime("2018-12-31T00:00:00Z")); // correct calculation
Expected result:
----------------
I expect to see 01-2019 as the output of the first line
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77144&edit=1