Reply to Re: Second Saturday?

Your name:

Reply:


Posted by Geoff Berrow on 07/08/06 09:43

Message-ID: <MPG.1f19a6cdc255be9a9896c6@news.aardvark.net.au> from Joe
contained the following:

>Nope - couldn't get it to work the way I wanted. <sigh> Pity though. It
>would have been handy for so many things. General meetings of clubs and
>non-profits are often on "third Tuesday", "first Friday" and so on.

I need this too, for folk sessions which are on similar dates. Try
this:

<?php
//set up what you want e.g. 1st Friday
$frequency=1;
$day="Fri";

$count=0;

for($j=7;$j<13;$j++){
$found=false;
$count=0;
for($i=1;$i<31;$i++){
$stamp=mktime( 0, 0, 0, $j, $i, 2006);
if( date("D",$stamp)==$day){
$count++;
if($count==$frequency &&
$stamp>strtotime('now')){
$found=true;
}
}
if($found){
echo date("D F d",$stamp)."<br>";
$found=false;
}
}
}

?>

I need to work on it a little more because some events are of the form,
last friday, which can be either the 4th or 5th Friday in the month.

--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация