RE: How to determinate the date of the next Wendsday?
| From: | Tim Ward | Date: | Mon, 20 Nov 2000 15:04:51 +0000 |
| Subject: | RE: How to determinate the date of the next Wendsday? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26274@lists.php.net to get a copy of this message | ||
this sort of thing is what I'd use
function nextday($ndTimeStamp, $ndDay /* 1=monday, etc. */)
{ $ndStartDate = getdate($ndTimeStamp);
$ndDaysToAdd = ($ndDay - $ndStartDate["wday"]);
if ($ndDaysToAdd <= 0) $ndDaysToAdd += 7;
return $ndTimeStamp + ($ndDaysToAdd * 60 * 60 * 24);
};
Tim Ward
Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html
> -----Original Message-----
> From: Robert Vetter [mailto:vetter@rundschau-onlinedienst.de]
> Sent: 20 November 2000 12:10
> To: php-general@lists.php.net
> Subject: How to determinate the date of the next Wendsday?
>
>
> Hello,
>
> I'm trying to write a PHP function, which should determine the date of
> the following Wendsday from the current date. I first thought it would
> be easy, but I've been trying since 30 min. and I still don't have any
> good idea. Any suggestions?
>
> Thanks a lot
>
> Robert.
>