From:             [EMAIL PROTECTED]
Operating system: Linux, Windows
PHP version:      4.2.2
PHP Bug Type:     Date/time related
Bug description:  date('W') - not ISO 8601 

<?php
  print date('W', strtotime('20050101')); //prints '0'
  print date('W', strtotime('20023112')); //53 instead of 1
?>

ISO-8601 weeks always start on Mondays. The first week is the first week
with 4 or more days in January.
Don't know why the first example returns 0.. However it seems to me that
date('W') just takes the first of January as the starting day for the
week-count.




-- 
Edit bug report at http://bugs.php.net/?id=19470&edit=1
-- 
Try a CVS snapshot:  http://bugs.php.net/fix.php?id=19470&r=trysnapshot
Fixed in CVS:        http://bugs.php.net/fix.php?id=19470&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=19470&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=19470&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=19470&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19470&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=19470&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=19470&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=19470&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=19470&r=globals

Reply via email to