note 46701 deleted from function.strtotime by derick
| From: | derick@php.net | Date: | Sun, 15 Jul 2007 12:51:17 +0000 |
| Subject: | note 46701 deleted from function.strtotime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-128594@lists.php.net to get a copy of this message | ||
Note Submitter: matt at farleyfamily dot net
----
Here's a good way to find the next X Weekday of the month (ie the next 3rd Tuesday of the
month)
<?
# set nextmtg to 3rd tuesday after the first of the month
$nextMeeting = strtotime("+2 week Tuesday", strtotime("first
".date("F"))) + 43200;
# if nextmtg is past, set it to 3rd tuesday after first of next month
if ($nextMeeting < time())
$nextMeeting = strtotime("+2 week Tuesday", strtotime("first
".date("F",strtotime("month")))) + 43200;
$nextMeeting = date("F dS, Y", $nextMeeting);
echo " <p>√ <strong>$nextMeeting</strong></p>";
?>