RE: [PHP] Week number?
| From: | Brian Paulson | Date: | Thu, 03 Aug 2000 19:04:50 +0000 |
| Subject: | RE: [PHP] Week number? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10010@lists.php.net to get a copy of this message | ||
Try this
Function getWeek()
{
//Get the day of the year.
$dayofyear = date("z");
//Devide Day of year by 7 the number of days in a week
//and round to nearest whole number.
$weeknum = round($dayofyear/7);
return $weeknum;
}
print(getWeek());
Thank you
Brian Paulson
Sr. Web Developer
1-800-279-6397 X207
bpaulson@chieftain.com
*************************
>-----Original Message-----
>From: Dragos Roua [mailto:dragos@mirabilis.ro]
>Sent: Thursday, August 03, 2000 12:42 PM
>To: php-general@lists.php.net
>Subject: [PHP] Week number?
>
>
>Hi there,
>
>Is there any pre-made function to find out the week number in a
>given month? Or,
>to be more detailed, the week number in the given month for a given date? I
>think it has to have somthing to do with "% 7" piece of code but I
>think I have
>already too much coffeine :-(
>
>Sorry if the answer of this is an obvious one and I bother
>everybody else...
>
>TIA.
>--
>Dragos Roua
>Mirabilis Media,
>http://www.portal.ro
>http://www.net-info.ro
>http://www.analyser.ro http://www.adserver.ro
>http://www.culinar.ro http://www.cartipostale.ro
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>