Date::Manip will almost certainly do everything you want (and more). None of the design-by-committee, O'Woe engineered alternatives come close for its functionality.

But...If only that functionality were documented worth a damn.

You probably want the DateCalc() function, to construct a delta thingy from your two dates.

But then, you will need to examine (use; print; base decisions upon), the result of that function...and that's where good things go queer. Because, In all the (excessive verbose and tortuous) documentation I've read (and read, and re-read), no where is the return value of DateCalc() documented. Which makes it decidedly hard to...um...decide, what to do with it, once you have it.

Of course, what you will need to do with it will depend largely upon what you want to do with it, but since you don't know what "it" is, it makes the decision of how to do what you want to do with it all the harder.

If you're lucky, sbeck, the clever and dedicated author of Date::Manip will breeze by and explain exactly and succinctly (his post are, unlike his documentation), what you need. Unfortunately, he does not appear to be a regular visitor.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

In reply to Re: calculate date difference by BrowserUk
in thread calculate date difference by hujunsimon

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.