Re: Getting days of week out of weeknumber
| From: | Andrey Hristov | Date: | Fri, 26 Jul 2002 14:53:05 +0000 |
| Subject: | Re: Getting days of week out of weeknumber | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-86241@lists.php.net to get a copy of this message | ||
This is not the appropriate place for asking this question.
The right place is : php-general list.
Look at the documentation of strftime() and you will see that there are 3
different formats for week number ->
%U, %V, %W . My suggestion to you is to multiply to the week number by 7 and
add to 1 -> use gmmktime(0,0,0,1,1+$week_num*7,$the_year). This will return
you unixtimestamp of some day in your week. Than using gmstrftime() get the
weekday num. Use again gmmktime() to generate the unixtimestamp of 00:00:00
of the Monday -
gmmktime(0,0,0,1+$week_num*7 -
gmstrftime('%u',gmmktime(0,0,0,1,1+$week_num*7,$the_year))+1,$your_year);
//%u does not work under Windows.
It must be something like that.
Regards,
Andrey
----- Original Message -----
From: "Rainer Schreiber" <rainer.schreiber@hairplus.nl>
To: <php-dev@lists.php.net>
Sent: Friday, July 26, 2002 3:24 PM
Subject: [PHP-DEV] Getting days of week out of weeknumber
> I am looking for a function wich can deliver me an array with the days of
a
> specific week.
> The function should recieve $year and $weeknumber and return
> $day[0]..$day[6].
>
> f.i.: $year = '2002' and $weeknumber = '31' ->
> $day[0] = '28-07-2002'
> $day[1] = '29-07-2002'
> $day[2] = '30-07-2002'
> $day[3] = '31-07-2002'
> $day[4] = '01-08-2002'
> $day[5] = '02-08-2002'
> $day[6] = '03-08-2002'
>
> Who can help me out?
>
> --
> Rainer Schreiber [consulent]
> Instituut Maidenhead / Hairplus
> Hoekersingel 22
> 3028 XM Rotterdam
>
> Tel. 010-462.30.11
> Fax. 010-462.33.70
> E-mail. rainer.schreiber@hairplus.nl
>
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>