Danger Will Robinson!

I used Date::Calc a while back when grovelling through web logs. In essence, I wanted to split out information week by week. I used Time::Local to convert the the web timestamp into epoch time. I then had to walk backwards, firstly to get back to Sunday 0:00, and from there walk backwards week by week.

The details are a little hazy, and in any event the project got wiped out by a catastrophic hard disk failure before I backed things up.

The thing is, I was using Date::Calc::Add_Delta_DHMS, walking back week by week, and started getting weird off-by-one errors. In the end I got around the problem by just dealing with epoch time and subtracting 86400*7, and the numbers came out fine.

I did mean to prepare a test to prove or disprove the bug, but ran out of tuits. All that to say watch out if you use the Add_Delta_* functions.

grinder

In reply to Beware Date::Calc::Add_Delta_DHMS by grinder
in thread Good & Easy Date Module? by oakley

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.