You can use Date::Manip to obtain the delta between one date and the other. Here's an example:
use Date::Manip; $date1=&ParseDate('2004-10-28'); $date2=&ParseDate('2003-10-23'); $delta=&DateCalc($date1,$date2,\$err,1); print $delta."\n";
The content of $delta is a string which you have to know how to read. The format is:
YY:MM:WK:DD:HH:MM:SS (the years, months, etc. between the two)
Actually, there are several options for date comaprison. Read perldoc Date::Manip for more information.

Michele.

In reply to Re: date comparison by arthas
in thread date comparison by Anonymous Monk

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.