Sorry for the tardy reply... I don't get on perl monks more often than every few days.

The original post doesn't include the version they are using which is unfortunate. I'm assuming that it's from the pre 6.00 era. The '%dyd' style formats are from the newer version of Date::Manip, so they won't work with a 5.xx era script.

Also, the original post said he expected (not sure if it was good or bad) around 60+ days for both types of delta, and that shouldn't be a desired result since a business delta by definition is excluding a bunch of days (weekends) so it should be smaller by a factor of approximately 5/7.

If I wanted to know how many days were in the deltas, I'd do the following:

#Standard Days
my $standard_delta = DateCalc($start,$end,0);
my $standard_days  = Delta_Format($standard_delta,2,'%dt');
print "$standard_delta :: $standard_days\n";

#Business Days
my $business_delta = DateCalc($start,$end,3);
my $business_days  = Delta_Format($business_delta,2,'%dt');
print "$business_delta :: $business_days\n";

and the results were:

+0:0:9:4:0:0:0 :: 67.00
+0:0:0:47:0:0:0 :: 47.00

Note that I changed the business day calc mode to 3 (which is an exact business delta). By treating both exactly, you get accurate numbers which you won't get with approximate deltas.


In reply to Re^2: DateManip Delta_Format Usage by SBECK
in thread DateManip Delta_Format Usage by nabrown737

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.