I'm not sure why this isn't working. It was working a little while ago and i don't recall changing it in any way but for some reason it's stopped now and i can't for the life of me figure out why.

Here's that particular section of code...

my $end_time = 1244572189; my ($Dd, $Dh, $Dm, $Ds) = timeDiff(localtime($end_time)); sub timeDiff(@) { my ($sec1, $min1, $hour1, $mday1, $month1, $year1, $dayofweek1, $dayofyear1, $isdst1) = @_; my ($sec2, $min2, $hour2, $mday2, $month2, $year2, $dayofweek2, $dayofyear2, $isdst2) = localtime(); $mday1 ++; $mday2 ++; $year2 = $year2 + 1900; $year1 = $year1 + 1900; return Delta_DHMS($year2, $month2, $mday2, $hour2, $min2, $sec2, $year1, $month1, $mday1, $hour1, $min1, $sec1); }
I've tried without incrementing the months or adding to the year, which i didn't have before when it was working. Anyone see what i might be doing wrong?

In reply to Date::Calc::Delta_DHMS(): not a valid date 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.