note 46700 added to function.strtotime

From: Date: Wed, 20 Oct 2004 15:52:53 +0000
Subject: note 46700 added to function.strtotime
Groups: php.notes 
Request: Send a blank email to php-notes+get-78839@lists.php.net to get a copy of this message
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>&radic; <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+46700 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46700&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46700&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46700&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46700&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46700&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46700&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+46700&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#78839) next »