ID: 14422 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Date/time related Operating System: Win32 PHP Version: 4.0.6 New Comment:
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) Previous Comments: ------------------------------------------------------------------------ [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]