note 60864 deleted from function.date by nlopess
| From: | nlopess@php.net | Date: | Wed, 18 Jan 2006 19:23:17 +0000 |
| Subject: | note 60864 deleted from function.date by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-102041@lists.php.net to get a copy of this message | ||
Note Submitter: p at patrick dot net
----
I had a hard time converting an arbitrary date to the correct week (weeks start on Sunday, ISO be
damned). Here's how to do it:
Given $date like '31 12 2005':
print date('W', strtotime("$date") + 24*60*60 );
The additional 24*60*60 seconds are to make sure that Sunday is counted in the right week.
Patrick