note 18278 deleted from function.mcal-week-of-year by nlopess
| From: | nlopess@php.net | Date: | Fri, 19 Dec 2003 10:40:08 +0000 |
| Subject: | note 18278 deleted from function.mcal-week-of-year by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62224@lists.php.net to get a copy of this message | ||
Note Submitter: saveli@yahoo.com
----
[Ed Note: date('W') also gives week number of the year.
--irc-html@php.net]
little function to replace the MCAL one..
function week_of_year($nDay, $nMonth, $nYear){
$date = getdate(mktime(9, 0, 0, $nMonth + 1, $nDay, $nYear)); // 9:00AM at that day
return floor($date["yday"]/7) + 1;
}