in reply to Re^6: Date::Manip and daylight savings
in thread Date::Manip and daylight savings
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Date::Manip and daylight savings
by ikegami (Patriarch) on Nov 08, 2011 at 18:04 UTC | |
by SBECK (Chaplain) on Nov 08, 2011 at 18:44 UTC | |
by ikegami (Patriarch) on Nov 08, 2011 at 19:49 UTC | |
by BrowserUk (Patriarch) on Nov 08, 2011 at 18:30 UTC | |
by Anonymous Monk on Nov 08, 2011 at 18:48 UTC | |
by ikegami (Patriarch) on Nov 08, 2011 at 19:48 UTC |