The
strtotime function is useful for this sort of thing. Here is a little routine that calculates the 2nd and 4th Saturdays in May (as an example):
<?PHP
$wk = strtotime ("first saturday may 2009");
if ($wk == false) {
echo "<br>Not able to interpret the string ";
exit;
}
$sat2 = $wk + (3600*24*7); // add seven days (in seconds)
$sat4 = $sat2 + (3600*24*14); // add 14 days
$wk2 = date ("Y-m-d",$sat4);
echo $wk2;
?>
Reputation Points: 210
Solved Threads: 228
Nearly a Posting Virtuoso
Offline 1,389 posts
since Sep 2008