note 27509 deleted from function.getdate by bobby

From: Date: Fri, 08 Sep 2006 14:39:34 +0000
Subject: note 27509 deleted from function.getdate by bobby
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-116911@lists.php.net to get a copy of this message
Note Submitter: coolen at astron dot nl ---- 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; }

« previous php.notes (#116911) next »