Incorrect conversation in function OracleToDelphiTimestamp when the result is a negative value.

Andrik75

Member
Hello Marco,

Working with DOA 4.1 I've faced with an issue as "Record has been changed by another user" when operating with a timestamp DB field and the value there is near to TDateTime(0) (it represents 30/12/1899 there). I've figured out that the function OracleToDelphiTimestamp returns incorrect result for negative values that causes the issue when the field is being checked before edit. A fix proposed is shown on the image http://take.ms/EBgxd .
The last lines there should be as
DD := EncodeDate(Year, Month, Day);
if DD >= 0 then begin
DD := DD + EncodeTime(Hour, Min, Sec, MSec);
end else begin
DD := DD - EncodeTime(Hour, Min, Sec, MSec);
end;

Or
DD := EncodeDateTime(Year, Month, Day, Hour, Min, Sec, MSec);

EncodeDateTime is a function from System.DateUtils unit.

Please apply it in the next DOA releases.
Regards, Andrik75
 
Last edited:
Additional information : The issue described has a place there only when the current session time zone differs than windows time zone and is set as time zone region (TZR) like 'Europe/Helsinki' rather than TZH:TZM
 
Back
Top