Re: "weeks" via date function
| From: | Scott Hurring | Date: | Fri, 19 Jul 2002 17:41:47 +0000 |
| Subject: | Re: "weeks" via date function | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-14845@lists.php.net to get a copy of this message | ||
you could use date('z') to get the day of year, and divide by 7.
but i have a feeling that you don't want to count *full* weeks,
but rather do it like a calendar does... you could probably
find out what day of the week the 1st of the year falls on,
then add/subtract to date('z') before dividing.
but i don't have any example code... i had to do that once
with perl, about 2 years ago and IIRC it was a little tricky,
but not very complicated.
--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
"Wolfgang Schneider" <schneider@bibelcenter.de> wrote in message
news:200207190826.g6J8Q9Ut011792@smtp.netcologne.de...
> Hello everyone,
>
> I have a question concerning how to determine the week of the year
> via the date functions in php ...
>
> Does anyone have a suggestion on how to set up some code to determine
> which "week of the year" the "current date" is in, that is for
> today's date (19 July 2002) it should return "29" (this being the
> 29th week of 2002).
>
> I've checked info on "date" in various sources available to me, but
> couldn't find a hint on how to do it ...maybe I am just blind . Any
> helpful information is gladly appreciated ... whether you have a
> sample or just a place to point me to to check. You can also reply to
> me privately, if this is not an appropriate topic for this list.
>
> Thanks in advance.
> God bless you with His grace and peace
> Wolfgang
>
> Looking for Biblical information? COME AND SEE!
> -- ONLINE Courses: http://classes.bibelcenter.de ... NEW!
> -- BibelCenter: http://www.bibelcenter.de
> -- Bookstore: http://www.worthy.net/BibelCenter/
>
>
>