php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71393 Bug with Date('W', $date) function usage
Submitted: 2016-01-16 21:21 UTC Modified: 2016-01-16 22:39 UTC
From: barret91 at hotmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.5.31 OS: Ubuntu 14.04.3 LTS
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: barret91 at hotmail dot com
New email:
PHP Version: OS:

 

 [2016-01-16 21:21 UTC] barret91 at hotmail dot com
Description:
------------
In this year (2016) date('W', $date); is counting less 1

Test script:
---------------
$today= date("Y-m-d");
$weekNumber = date("W",strtotime($today));

echo $weekNumber;



Expected result:
----------------
It echoes "2" but should echo "3"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-01-16 22:39 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2016-01-16 22:39 UTC] requinix@php.net
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

http://php.net/manual/en/function.date.php
> W	ISO-8601 week number of year, weeks starting on Monday
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 11:02:27 2025 UTC