|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7640 problem with weeknumbers
Submitted: 2000-11-04 17:59 UTC Modified: 2000-11-05 00:23 UTC
From: jesper at barra dot se Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.0.3pl1 OS: Linux
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.
Block user comment
Status: Assign to:
Bug Type:
From: jesper at barra dot se
New email:
PHP Version: OS:


 [2000-11-04 17:59 UTC] jesper at barra dot se
print strftime("%V",mktime(0,0,0,12,31,1999));
# prints weeknumber 52
print strftime("%V",mktime(0,0,0,01,01,2000));
# prints weeknumber 53


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-04 20:16 UTC]
That is expected behaviour.  Please read the manual:

%V - The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week.
 [2000-11-04 23:52 UTC]
A small correction. This *isn't* the expected result. Or at least, with my understanding of the actual definition of %V.
They should both be 52.

But keeping closed anyway, this is not a PHP related bug.
PHP just calls the systems c-library function strftime and
passes the result back. Nothing to fix unless we roll up our
own version (in which case there could be too much to
 [2000-11-05 00:23 UTC]
True.  And on my Linux the specific example returns 52 and 52.  
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 02:01:29 2024 UTC