Looking for a date function : "First Monday after a certain date"
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Looking for a date function : "First Monday after a certain date"

From: Martien van Wanrooij <info(verwijderdit)@martienvanwanrooij.nl>
Date: Sat Jul 30 2005 - 21:28:42 CEST

I would like to retrieve, let us say, the First Monday after a certain date,
so my (imaginary) function
could be something like
echo weekdayAfter("28 July 2005", "Monday") should return "1 August 2005",
(or a timestamp that could be formatted).
I have been thinking about creating a loop that increases the source date
$myDate with 24*60*60 until date("l", $myDate) = "Monday" but maybe I am
trying too complicated solutions and overseeing more easy ones.
Any suggestions?

Martien van Wanrooij
Received on Tue Oct 18 02:06:28 2005