Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Business Date Range Only

by poj (Priest)
on Aug 01, 2014 at 20:31 UTC ( #1095954=note: print w/ replies, xml ) Need Help??


in reply to Business Date Range Only

I'm guessing you are not using the latest version of Date::Manip 6.46. You could try

$delta=Delta_Format(DateCalc($start_date_parsed,$end_date_pa +rsed),'',"%dt"); # changed from %dv
but if you did upgrade you could use the OO interface like this
use strict; use Date::Manip; my $start_date = '8/4/2014'; my $end_date = '8/15/2014'; print "$start_date to $end_date \n"; my $date1 = new Date::Manip::Date; my $date2 = $date1->new_date(); my $err1 = $date1->parse($start_date); my $err2 = $date2->parse($end_date); while ($date1->cmp($date2) <= 0) { print $date1->printf("%m-%d-%Y")."\n"; $date1->next_business_day(1); }
poj


Comment on Re: Business Date Range Only
Select or Download Code
Re^2: Business Date Range Only
by Anonymous Monk on Aug 06, 2014 at 15:41 UTC
    Excellent solution.
    I upgraded and this did exactly what I need it to do.
    Thanks a million!!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1095954]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (13)
As of 2015-07-02 21:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (45 votes), past polls