There is an internal QC report that I created (21701) that deals with this issue. D2006 changed the behavior of TryEncodeDateTime (which is used by RecodeTime) so that it may return negative values when you don't expect it to. For example, a call like this returns a negative value: aDate := RecodeTime(0, 12, 0, 0, 0);
A snippet from the D2006 TryEncodeDateTime method looks like this:
Result := TryEncodeDate(AYear, AMonth, ADay, AValue);
if Result then
begin
Result := TryEncodeTime(AHour, AMinute, ASecond, AMilliSecond, LTime);
if Result then
if AValue > 0 then
AValue := AValue + LTime
else
AValue := AValue - LTime
I copied the methods I needed from DateUtils and made local copies and changed them to revert back to the code in D6. However, one person commented that performing the check, "if AValue >=0 then" would also work. Hopefully this gets fixed in Update 2.