in reply to Calculating next business day (weekends/holidays taken into account)
You need to increment the day by one and check if it's not a holiday/weekend day. But incrementing days gets hairy, so use one of the great date modules from cpan to do it. I use Date::Calc or for an OO module DateTime.
In fact converting you entire script to use DateTime for dates would be a good thing. It'll end up being far more maintainable in the long run, and looking at what you have so far not to much of a change.
grep
One dead unjugged rabbit fish later...
One dead unjugged rabbit fish later...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Calculating next business day (weekends/holidays taken into account)
by vxp (Pilgrim) on Jun 24, 2009 at 20:25 UTC | |
by afoken (Chancellor) on Jun 24, 2009 at 21:51 UTC | |
by Herkum (Parson) on Jun 24, 2009 at 21:16 UTC | |
by vxp (Pilgrim) on Jun 24, 2009 at 21:34 UTC | |
by grep (Monsignor) on Jun 25, 2009 at 02:46 UTC |
In Section
Seekers of Perl Wisdom