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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 03:02:51 2024 UTC