"Anthony" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've run into a bit of a problem, that I know has been dealt with before, > but I don't know how to deal with it. Very simple, I have an application > that needs to do calendar math and do it specifically on business days. I > need to be able to add and subtract a number of days to only Monday though > Friday. Seems simple enough, but I can't figure out how to do it. The only > think I've come up with so far is to build a function that counts every day > and checks to see if it's a weekend or not. This wouldn't be all that hard > to do, but I'm wondering if there is a better way to do it? Anyone have a > really efficient function to do this, I need to figure out a LOT of dates in > this app. > > - Anthony
Hi Anthony, take a look at PEAR's Calendar package: http://pear.php.net/package/Calendar There is a simple example for building a calendar. Maybe you can adapt it by ignoring weekends: http://pear.php.net/manual/en/package.datetime.calendar.intro-inahurry.php Regards, Torsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php