|
Posted by Rik Wasmus on 10/14/07 19:29
On Sun, 14 Oct 2007 21:24:24 +0200, Chris <matchett123@googlemail.com> =
wrote:
> On Oct 11, 11:29 pm, Lars Eighner <use...@larseighner.com> wrote:
>> In our last episode,
>> <1192140304.180826.282...@g4g2000hsf.googlegroups.com>,
>> the lovely and talented Chris
>> broadcast on comp.lang.php:
>>
>> > I am trying to output Monday of the current week i.e. if Monday is =
the
>> > 8th I want to display 'Monday 8th' for any date between Monday 8-14=
th.
>> > I would appreciate any help, the code below is heading in the right=
>> > direction but doesn't quite give me the results I am looking for.
>> > $givenday =3D mktime(0,0,0,10,08,2007);
>> > $Monday =3D strtotime("Monday this week",$givenday);
>> > echo date("j M Y H:i:s", $Monday);
>> > Cheers,
>> > Chris
>>
>> This seems to work for me.
>>
>> php -r "echo date('j M Y H:i:s',strtotime('last Monday', \
>> strtotime('Sunday')));"
>>
>> You want the Monday previous to next Sunday.
>>
>> --
>> Lars Eighner <http://larseighner.com/> =
>> <http://myspace.com/larseighner>
>> Countdown: 466 days to go.
>> What do you do when you're debranded?
>
> Cheers Lars!
>
> I wanted a link to show this monday, then the next etc. Your code
> helped, will continue to build on it.
>
> $monday =3D date('j M Y', strtotime('last Monday',
> strtotime('Sunday')));
> $unixtime_monday =3D strtotime($monday);
Euhm, what am I missing?
$monday =3D date('j M Y', strtotime('last Monday',strtotime('Sunday')));=
$unixtime_monday =3D strtotime($monday);
Would be equal to:
$unixtime_monday =3D strtotime('last Monday',strtotime('Sunday'));
is it not?
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|