Joe Dundas
Member since Jan 22, 2009
- Profile: /members/2813-joe-dundas.htm
- URL: http://www.eiassistant.com
- Comments: 2
Recent Blog Comments By Joe Dundas
-
Getting the Nth Occurrence Of A Day Of The Week For A Given Month
Posted on Mar 10, 2009 at 2:56 PM
Hi John, Take the ceiling of $D/7. Where $D is the day of the month. For example, for 2/11/2009. $D = 11; $occurrence = ceil($D/7) = ceil(1.57) = 2... read more »
-
Getting the Nth Occurrence Of A Day Of The Week For A Given Month
Posted on Jan 22, 2009 at 11:11 AM
I wrote this algorithm in PHP. It can probably pretty easily be converted to any language. Read the comments that I inserted in the code to get an idea of how the algorithm works. This will give you any occurrence of a day of week. For example, the third Tuesday of the month, the last Friday of t... read more »