NYCPHP Meetup

NYPHP.org

[nycphp-talk] Business day calculations

Scott Mattocks scott at crisscott.com
Tue Nov 23 13:23:12 EST 2004


Try PEAR::Date There is getNextWeekday() and getPrevWeekday(). To get 
the last business day of the month you may have to combine a few calls 
but there should be enough there to get what you need without having to 
reinvent everything.

http://pear.php.net/package/Date/docs/1.4.2/Date/Date.html#methodgetNextWeekday

Scott Mattocks

Faber Fedor wrote:

> Before I go and reinvent the wheel...
> 
> I need to do things like getPreviousBusinessDay() and
> getLastBusinessDayofMonth() in a PHP-based dashboard I'm writing.  I
> Googled for such code and checked out PEAR but I didn't find anything
> appropriate.  Am I missing something or has a PHP programmer never
> needed to do a getPreviousBusinessDay() type function before?
> 

-- 
Scott Mattocks
scott at crisscott.com
http://www.crisscott.com
http://pear.php.net/user/scottmattocks



More information about the talk mailing list