note 27509 added to function.getdate
| From: | coolen at astron dot nl | Date: | Mon, 09 Dec 2002 12:36:41 +0000 |
| Subject: | note 27509 added to function.getdate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40567@lists.php.net to get a copy of this message | ||
Yup, it does so the getdate gives you the wrong daynumber.
using the following modification will give you the exact weeknr:
function week_of_year($nDay,$nMonth,$nYear)
{
$date=getDate(mktime(9,0,0,$nMonth,$nDay,$nYear));
$weeknr=floor(($date["yday']+1)/7)+1;
$weeknr %=52;
return $weeknr;
}
--
http://www.php.net/manual/en/function.getdate.php
http://master.php.net/manage/user-notes.php?action=edit+27509
http://master.php.net/manage/user-notes.php?action=delete+27509
http://master.php.net/manage/user-notes.php?action=reject+27509