note 45381 added to function.date
| From: | mspellecacy at frakle dot com | Date: | Sat, 04 Sep 2004 00:23:50 +0000 |
| Subject: | note 45381 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-76004@lists.php.net to get a copy of this message | ||
I was confronted with the needed to find the nearest 'workday' to rounding up from 30 days
into the future...ignoring holidays and such this is what I came up with:
<?php
$i=30;
while ((date("D",strtotime("+$i days")) == ("Sat")) ||
(date("D",strtotime("+$i days")) == ("Sun"))) {
$i++;
};
echo date("l F jS, Y",strtotime("+$i days"));
?>
is there a better solution that I'm just overlooking?
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45381
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45381&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45381&report=yes
Search -- http://master.php.net/manage/user-notes.php