Bug #70314 [Opn->Nab]: Function date();
| From: | rasmus@php.net | Date: | Thu, 20 Aug 2015 20:05:50 +0000 |
| Subject: | Bug #70314 [Opn->Nab]: Function date(); | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195379@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70314&edit=1
ID: 70314
Updated by: rasmus@php.net
Reported by: francois dot guerlez at gmail dot com
Summary: Function date();
-Status: Open
+Status: Not a bug
Type: Bug
Package: Unknown/Other Function
Operating System: Debian Jessie
PHP Version: 5.6.12
Block user comment: N
Private report: N
New Comment:
This looks correct to me. ISO week 01 for 2015 can start in 2014. Read
https://en.wikipedia.org/wiki/ISO_week_date
carefully. Especially:
If 31 December is on a Monday, Tuesday or Wednesday, it is in week 01 of the next year.
In 2014 Dec.31 was on a Wednesday so Monday 12-29 is in week 01 which PHP is correctly telling you.
Previous Comments:
------------------------------------------------------------------------
[2015-08-20 18:21:12] francois dot guerlez at gmail dot com
Description:
------------
The function date() doesn't return the expected value.
Test script:
---------------
<?php
$date = '2014-12-29';
$time = strtotime($date);
$date = date('Y-m-d', $time);
echo "$date\n"; // Display : 2014-12-29
$date = date('Y-W', $time);
echo "$date\n"; // Display : 2014-01
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70314&edit=1