note 46700 rejected from function.strtotime by sean
| From: | sean@php.net | Date: | Wed, 20 Oct 2004 15:54:34 +0000 |
| Subject: | note 46700 rejected from function.strtotime by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78841@lists.php.net to get a copy of this message | ||
Note Submitter: matt at farleyfamily dot net
----
Is this the best way to automatically get the next 3rd tuesday of the month? I.e. if the date is
currently before the 3rd Tuesday of the month it displays that upcoming 3rd Tuesday, however if we
are past that 3rd Tuesday, it displays the 3rd Tuesday of the next 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>";
?>