From the POD:
In any case, adding the result of this function to the first date/time + value ($year1,$month1,$day1, $hour1,$min1,$sec1) always gives the se +cond date/time value ($year2,$month2,$day2, $hour2,$min2,$sec2) again +, and adding the negative result (all elements of the result vector n +egated) to the second date/time value gives the first date/time value +.
As you can see, the specification for what Delta_YMDHMS() and Delta_DHMS() return is defined in terms of complimentary operations, not any particular representation of values. So in your example (hr/day labels fixed):
Today_and_Now value: 2003-12-1-14-52-15
End time value: 2004-4-1-0-0-0
Function |Yrs |Mons |Days |Hrs |Mins |Secs
-------------------------------------------------
Delta_DHMS | N/A| N/A| 121| 9| 7| 45
Delta_YMDHMS | 1| -8| 0| -14| -52| -15
Add_Delta_YMDHMS() (no modulo, no carry):
original: 2003 | 12 | 1 | 14 | 52 | 15
+ delta: 1 | -8 | 0 | -14 | -52 | -15
-------------------------------------------------
end: 2004 | 4 | 1 | 0 | 0 | 0
- delta: 1 | -8 | 0 | -14 | -52 | -15
-------------------------------------------------
original: 2003 | 12 | 1 | 14 | 52 | 15
Add_Delta_DHMS() (modulo, columnar carry, calendrical):
math:| calendrical |mod24|mod60|mod60
-------------------------------------------------
original: 2003-12-01 | 14 | 52 | 15
+ delta: 121 | 9 | 7 | 45
-------------------------------------------------
end: 2004-04-01 | 0 | 0 | 0
- delta: 121 | 9 | 7 | 45
-------------------------------------------------
original: 2003-12-01 | 14 | 52 | 15
As you can see, there's no actual calendrical or modulo/carrying calculations going on with Delta_YMDHMS(). Delta_DHMS(), on the other hand, does do it that way.
Nowhere in the documentation does it state that the Delta_* functions perform their arithmetic in the same fashion, or represent their results the same way. They are merely guaranteed to provide symmetry for the Add_Delta_* functions.
Matt
In reply to Re^3: Unexplained Behavior in Date::Calc
by mojotoad
in thread Unexplained Behavior in Date::Calc
by jpfarmer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |