Here's the deal with Date::Manip.

There are some differences between how DateTime and Date::Manip do calculations. I don't know that I agree that either is 'right' or 'wrong' because so much of it is subject to opinion... however, let me see if I can detail the differences.

Date::Manip can add a year, and most of the time it's result is the same as DateTime. One difference is that 2004-02-29 plus one year is 2005-02-28. With DateTime, the result is 2005-03-01.

Date::Manip can add a month. 2004-03-31 plus one month is 2004-04-30. With DateTime, the result is 2004-05-01.

Date::Manip can add a minute, but unlike DateTime, I don't use leap seconds, so a minute is always 60 seconds. Unlike leap years, variable length months, and daylight saving time transitions, leap seconds are not something the people use in a day-to-day usage, and since I was trying to do operations as people did them, I chose to ignore leap seconds. Date::Manip also does not use fractional seconds. They are never used, except they are allowed in parsing where they are truncated and ignored.

The relationship 1 day = 24 hours has been in Date::Manip all along, but I am working on changing that. Since adding true support for daylight saving time, that relationship isn't acceptable. However I'm not sure of all the details of how I want to change it, so I won't go into any more detail than what I said earlier in this thread. One thing though is that I won't throw an exception (or return an empty date). If you have a valid date and a valid amount of time, I'll try to figure out what is intuitively expected and return that, and so in the example above, I'll probably fall back on the 1 day = 24 hours so that I can return a valid date.


In reply to Re^7: Date::Manip and daylight savings by SBECK
in thread Date::Manip and daylight savings by ChrisDennis

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.