ID: 14422 Updated by: hholzgra Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Date/time related Operating System: Win32 PHP Version: 4.0.6 New Comment:
there are (at least) 3 different 'standards' for week-counting, that's why strftime has the %U %V and %W modifiers you have to check which standard your calendar uses and which of the three modifiers corresponds to it here in Germany this would usualy be %V and not %W, and i tink it's the same in your country (but usualy it is not consistent throughout a country, so strftime can't use the locale settings to find out what to do, you have to specify what you want) Previous Comments: ------------------------------------------------------------------------ [2001-12-12 06:31:16] [EMAIL PROTECTED] and by the way: week 1 of the year 2003 will start at Monday, 30. Dec. 2002 (and not Mon. 06. Jan. 2003) ------------------------------------------------------------------------ [2001-12-12 06:12:51] [EMAIL PROTECTED] yes, I see that (week 1 = first monday of the year). But look at your (printed) calendar of 2002: week 1 beginns at Monday, 31. Dec. 2001, and NOT at Monday, 07. Jan. 2002!!! so the PHP-Function strftime() gives wrong week numbers for the whole year 2002! A year has 52 or 53 weeks, starting with week 1, ending with week 52 or 53. A "week 0" don't exists! example: http://206.67.28.80/afnontv/scheds/60day/6_e201.htm Week 1 (MON 31 DEC 2001-SUN 6 JAN 2002) ------------------------------------------------------------------------ [2001-12-12 05:12:55] [EMAIL PROTECTED] bogusified ------------------------------------------------------------------------ [2001-12-12 05:12:40] [EMAIL PROTECTED] nope, see http://php.net/strftime: "%W - week number of the current year as a decimal number, starting with the first Monday as the first day of the first week" the uncomplete week before the first monday is week 0 ------------------------------------------------------------------------ [2001-12-11 05:28:24] [EMAIL PROTECTED] // Example: Week of Jan 01, 2002: $sec = mktime(0,0,0,1,1,2002); $week = strftime("%W", $sec); Result: $week = 00 !!! Should be: 01 ! ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=14422&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]