note 108963 deleted from function.date by salathe

From: Date: Fri, 08 Jun 2012 12:42:40 +0000
Subject: note 108963 deleted from function.date by salathe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-188461@lists.php.net to get a copy of this message
Note Submitter: sander at rotorsolutions dot nl ---- watch out with weeks $iso = date('Y-\WW', strtotime('2010-12-31')); echo($iso . '<br />'); echo('Year and week from iso: ' . date('Y-m-d', strtotime($iso)) . '<br />'); $iso = date('Y-\WW', strtotime('2011-01-01')); echo($iso . '<br />'); echo('Year and week from iso: ' . date('Y-m-d', strtotime($iso))); ===== RESULT ===== 2010-W52 Year and week from iso: 2010-12-27 2011-W52 Year and week from iso: 2011-12-26 Wich is incorrect it should be 2010-W52 Year and week from iso: 2010-12-27 2010-W52 Year and week from iso: 2010-12-27

« previous php.notes (#188461) next »