Re: Date Question: finding 1st Monday of sept.

From: Date: Fri, 22 Feb 2002 19:33:07 +0000
Subject: Re: Date Question: finding 1st Monday of sept.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-85919@lists.php.net to get a copy of this message
Nevermind, I figured it out, didn't see that you could pass a timestamp to strtotime. Thanks. On Fri, 2002-02-22 at 14:22, Jeff Bearer wrote: > Hello, > > I'm trying to find out how to calculate some dates, and the part I'm > having problems with is finding the date of the first Monday in > September. > > I'm looking into the strtotime() function which works some great magic > with dates, but I can't figure out how to use the day of the week syntax > start from a date other than today. > > You can use releative dates with units of days: > strtotime("2002-09-01 +2 weeks"); > > But I can't seem to get it to work with the weekdays, I'd assume it > would be something like this. > strtotime("2002-09-01 first monday") > > Is there a syntax that I'm missing or is there a way of fooling the > function to thinking it is September 1st so when I ask for next Monday > it will give me the correct date? > > > -- > Jeff Bearer, RHCE > Webmaster > PittsburghLIVE.com > 2002 EPpy Award, Best Online U.S. Newspaper -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper

« previous php.general (#85919) next »