I'm currently working with an older version of DateManip and for various reasons I can't upgrade it at the moment. I'm trying to calculate the number of days in the Delta between two dates. I need to be able to calculate this delta in both business and standard days. The issue arises that the code can't seem to convert months into days. Example:

$start = &DateManip::ParseDate('2013-10-03 00:00:00'); $end = &DateManip::ParseDate('2013-12-09 00:00:00'); #Standard Days my $standard_delta = &DateManip::DateCalc($start,$end,1); my $standard_days = &DateManip::Delta_Format($standard_delta,2,'%dt'); print "$standard_days\n"; #Business Days my $business_delta = &DateManip::DateCalc($start,$end,2); my $business_days = &DateManip::Delta_Format($business_delta,2,'%dt'); print "$business_days\n";

So I would expect this to print out the number of standard and business days somewhere in the 60s. Instead it ignores the difference of 2 months and prints out just the difference in days (6 standard days and 4 business days). This seems to be because it doesn't know with certainty how many weeks are in each month and thus can't convert from months to weeks and weeks to days. Any ideas on how I can get it to convert from months to days in both business and standard?


In reply to 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.