in reply to Business Date(s)

With the appropriate imports:
# get first of next month: my @first_of_next_month = Add_Delta_YM((Today)[0,1], 1, 0, 1); # get day of week my $dow = Day_of_Week(@first_of_next_month); # if it's 1..5, then use it, else move forward: my @first_weekday_of_next_month = Add_Delta_Days(@first_of_next_month, + $dow == 7 ? 1 : $dow == 6 ? 2 : 0);

-- Randal L. Schwartz, Perl hacker


update: yes, this finds the first weekday of the next month; however, without further input, I decided that was what was meant by "first business day". Holidays will throw this off.

Replies are listed 'Best First'.
Re: Re: Business Date(s)
by data67 (Monk) on Oct 17, 2001 at 20:26 UTC
    I am using  use Date::Calc qw(:all);
    why do I see this error "Undefined subroutine &main::Add_Delta_YM called at".
    Do you mean Add_Delta_YMD() instead? I tried that but i get a "usage" error.