Bug #65177 [Opn->Nab]: date('w') returns result in range 1-7 instead of 0-6
| From: | ab@php.net | Date: | Mon, 01 Jul 2013 22:08:59 +0000 |
| Subject: | Bug #65177 [Opn->Nab]: date('w') returns result in range 1-7 instead of 0-6 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-180005@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65177&edit=1
ID: 65177
Updated by: ab@php.net
Reported by: m dot zakarczemny+php at gmail dot com
Summary: date('w') returns result in range 1-7 instead of 0-6
-Status: Open
+Status: Not a bug
Type: Bug
Package: Date/time related
PHP Version: 5.4.16
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
The only difference is that for Sunday it's 0 in the first case and 7 in the
second.
Previous Comments:
------------------------------------------------------------------------
[2013-07-01 21:27:52] m dot zakarczemny+php at gmail dot com
Description:
------------
According to documentation (http://php.net/manual/en/function.date.php):
"
w Numeric representation of the day of the week 0 (for Sunday) through 6
(for Saturday)
N ISO-8601 numeric representation of the day of the week (added in PHP
5.1.0) 1 (for Monday) through 7 (for Sunday)
"
but date('w') returns day number in 1-7 range.
Test script:
---------------
<?php
echo date('l'), " ", date('w'), " ", date('N');
Expected result:
----------------
Tuesday 1 2
Actual result:
--------------
Tuesday 2 2
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65177&edit=1