note 46701 added to function.strtotime
| From: | matt at farleyfamily dot net | Date: | Wed, 20 Oct 2004 16:05:40 +0000 |
| Subject: | note 46701 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78842@lists.php.net to get a copy of this message | ||
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>";
?>
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46701
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46701&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46701&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46701&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46701&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46701&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46701&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46701&report=yes
Search -- http://master.php.net/manage/user-notes.php