#21572 [NEW]: date gives 0 as a week number of year

From: Date: Fri, 10 Jan 2003 22:14:17 +0000
Subject: #21572 [NEW]: date gives 0 as a week number of year
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-29724@lists.php.net to get a copy of this message
From: trio@surffi.saunalahti.fi Operating system: Redhat 8.0 PHP version: 4.2.2 PHP Bug Type: Date/time related Bug description: date gives 0 as a week number of year I found out that date("W", $stamp) can gives a zero as output. <?php $stamp = time(); while( date("W", $stamp ) != 0 ) $stamp+=5000; print date( "d.m.Y H:i W", $stamp ) . " $stamp\n"; ?> Out could be for examble "01.01.2005 00:46 0 1104533193". I check the ISO-8601 standard (version 2000-12-19 ISO/TC 154 N 362) and it says: calendar week is represented by two decimal digits. The first calendar week of a year shall be identified as [01] and subsequent weeks shall be numbered in ascending sequence. Futhermore the date function should have a option for 'normally' week number of the year like most of people does it understand practically: 1.1.xxxx is 1 and so on and finally 31.12.xxxx is 52. -- Edit bug report at http://bugs.php.net/?id=21572&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21572&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21572&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21572&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21572&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21572&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21572&r=support Expected behavior: http://bugs.php.net/fix.php?id=21572&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21572&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21572&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21572&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21572&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21572&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21572&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21572&r=gnused

« previous php.bugs (#29724) next »