php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22889 date doesn't return correct number of week
Submitted: 2003-03-26 02:55 UTC Modified: 2003-03-27 07:00 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ulrich dot staerk at spe-siemens dot de Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.3.1 OS: Windows 2000
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: ulrich dot staerk at spe-siemens dot de
New email:
PHP Version: OS:

 

 [2003-03-26 02:55 UTC] ulrich dot staerk at spe-siemens dot de
date("W",mktime(0,0,0,1,1,2005)) returns "1" where it should return "53" because January 1st and 2nd still belong to the last week of 2004. In an earlier version of php (4.2.3) on the same machine it simply returned "0" which was wrong too but could be corrected within my script.
This bug appears also in January 2006, 2010 (there seems to be an 10-day-long first week :-) ) and so on.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-26 08:57 UTC] ulrich dot staerk at spe-siemens dot de
there also seems to be a week number 1 from december 22, 2003 to january 4, 2004. i think this is an overall problem happening everywhere the first week is not completely in the new year or the last week not completely in the last year...
 [2003-03-26 15:51 UTC] pollita@php.net
This seems to be (yet another) case of Window's c library not following standards.  Linux and BSD are both reporting correctly for me.
 [2003-03-26 16:03 UTC] pollita@php.net
Hrmmm... correction... I just tested with latest snap on Win2K and got the correct answer (53).

Please try the current snapshot at http://snaps.php.net

If it fails, please update this bug with additional information including at least the following:

* Timezone
* Service Packs installed (if any)
* Standalone or member of domain? (unlikely to bear any importance, but could relate to time sync issues)
* Other actions being performed in same script
* non-standard .ini settings (any deviation from php.ini-dist)

 [2003-03-27 03:11 UTC] ulrich dot staerk at spe-siemens dot de
I now updated to the latest snapshot as you recommended. I'm running 4.3.2-RC now and it seems running fine. don't know what it is that produced theses errors.
some informations that might help to reproduce the error:

win2k server english service pack 3 build 2195 with ms iis.
php.ini-dist deviations:
cgi.force_redirect = 0
session.use_cookies = 0
session.use_trans_sid = 1
extension = php_mssql.dll

timezone: GMT +01:00
server is a domain member
other actions in script:
-some mssql queries
-lots of date-related stuff for this is going to be some kind of calendar
 [2003-03-27 07:00 UTC] sniper@php.net
works with 4.3.2-RC -> closed.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC