From: s dot vanvelthem at ibelgique dot com
Operating system: Redhat Linux 9
PHP version: 4.3.2
PHP Bug Type: Date/time related
Bug description: ISO8601 weeks date seems incorrect for week 52
Description:
------------
In PHP4.3.2, the function date('W', $timestamp) behaves differently from
PHP4.2.3 concerning the ISO8601 dates
For example (timestamps has been written in simple form for readablility),
date('W', '2003-12-31')
reports 1 in PHP4.3.2 (incorrect? Mysql returns the same result)
reports 53 in PHP4.2.3 (should be the correct behaviour?)
(ISO8601 weeks starting on Monday, so i think you could sometimes have a
53rd week in the year?).
It's difficult to differenciate same week between years as
date('Y-W', '2003-12-31') reports '2003-1'
Sorry for my english,
Thanks for your time.
Seb
Reproduce code:
---------------
$timestamp = strtotime("2003-12-31");
echo date('Y-W', $timestamp);
> outputs '2003-1'
--
Edit bug report at http://bugs.php.net/?id=24683&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24683&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24683&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=24683&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24683&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24683&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24683&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24683&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24683&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24683&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24683&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24683&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24683&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24683&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24683&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24683&r=gnused