php.net |  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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-04 20:16 UTC] rasmus@php.net
That is expected behaviour.  Please read the manual: http://www.php.net/manual/function.strftime.php

%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] jah@php.net
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
fix...).
 [2000-11-05 00:23 UTC] rasmus@php.net
True.  And on my Linux the specific example returns 52 and 52.  
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC