[wplug] PHP question on how to figure out 1st,2nd,3rd Thurs of month?

Russ Schneider russpgh at stargate.net
Thu Jul 3 09:08:29 EDT 2003


My brain is frozen on a convenient way to figure out if today is the 
1st, 2nd, 3rd, 4th, or last Thursday of the month.  Basically I need 
something that will figure this out for any given day for any given month.

date() has everything BUT a 0-5 return for this.

I have data from a calendar program that has a day (0-6) and how that 
day recurs, 0-5 where 0-5 is as follows:

0-all weeks
1-first occurance of
2-second " "
3-third " "
4-fouth " "
5-last " "

So if an entry has a 2 for recurring (meaning it falls on the second 
occurance of that day in the month) and a 4 indicating that day is 
"Thursday", I want to be able to figure out what today is, meaning which 
Thurday of the month this is, and then ultimately figure out the 
difference so I can deterimine the date when the entry next occurs.

Have I confused anyone yet?

-- 
Russ Schneider (a.k.a. Sugapablo)
http://www.sugapablo.com

Latest track:
http://candidate.zhrodague.net/Sugapablo-B-Run.ogg




More information about the wplug mailing list