Bug #3873: strftime's week calculation doesn't honour locale settings

From: Date: Sun, 19 Mar 2000 21:55:59 +0000
Subject: Bug #3873: strftime's week calculation doesn't honour locale settings
Groups: php.dev 
Request: Send a blank email to php-dev+get-17040@lists.php.net to get a copy of this message
From: mbj@isolve.dk Operating system: all systems PHP version: 3.0.15 PHP Bug Type: Misbehaving function Bug description: strftime's week calculation doesn't honour locale settings 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

« previous php.dev (#17040) next »