Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Business Date Range Only

by poj (Vicar)
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); }

Comment on Re: Business Date Range Only
Select or Download Code
Replies are listed 'Best First'.
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?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2015-10-05 02:18 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (106 votes), past polls