php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3873 strftime's week calculation doesn't honour locale settings
Submitted: 2000-03-19 16:55 UTC Modified: 2000-03-19 17:49 UTC
From: mbj at isolve dot dk Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.15 OS: all systems
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mbj at isolve dot dk
New email:
PHP Version: OS:

 

 [2000-03-19 16:55 UTC] mbj at isolve dot dk
PHP defines the first week of the year as either starting with the years first sunday or first monday (strftimes %U and %W switches). This doesn't honour e.g. the danish standards.

According to danish standards, and several other european countries i would guess, the first week of the year is defined as:

The first Thursday of any given year will always be in the first week of that year.

Thus week 1 of the year of 1998 was defined as 29/12-1997 to 4/1-1998.

The math behind this algorithm is pretty simple, so i hope it can be implemented as part of php 4.

If you will point me to where the code is in the sourcetree that handles these calculations, i will be happy to implement it (though i am not very strong in c, but i guess you can always clean it for memoryleaks and such when i deliver the raw algortithms)

/Martin Jespersen



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-03-19 17:49 UTC] rasmus at cvs dot php dot net
PHP uses your system's strftime() function.  If it is not doing the right thing for you, then your LOCALE is not set right.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 01:01:33 2024 UTC