Hello,
Test done with Firebird 2.5 under DXE7
Devart DBXdriver 4.6.9 (same problem with previous versions)
The problem : DBXDriver add milliseconds to timeStamp value
To reproduce set now() to a timeStamp : myDataSet.FieldByName('MYTIMESTAMP').AsDateTime := now; and then applyUpdates. => The timeStamp has millisecond in the dataBase
Function now() doesn't returns millisecond
I don't see paramaters to avoid this, so I suppose that it's a bug
Embarcadero DBXDriver doesn't add milliseconds when I set now to a timeStamp and doesn't returns millisonds in dataSet (but I can't say if return milliseconds is a bug).
I my project I don't want to display milliseconds in the DBGrids and so it's impoosible to make a filter on timestamp fields.
That's why I don't want to have milliseconds in timeStamp fields.
Thanks
Milliseconds are added to TimeStamp
Re: Milliseconds are added to TimeStamp
Thank you for the information. We are investigating this behavior of dbExpress driver for InterBase and Firebird, and we will inform you about the results.
To store a value without milliseconds in the TSQLTimeStamp field, you can use the following code:
To store a value without milliseconds in the TSQLTimeStamp field, you can use the following code:
Code: Select all
var
Time: TSQLTimeStamp;
begin
Time := DateTimeToSQLTimeStamp(Now);
Time.Fractions := 0;
myDataSet.Append;
myDataSet.FieldByName('MYTIMESTAMP').AsSQLTimeStamp := Time;
end;
Re: Milliseconds are added to TimeStamp
According to the official documentation, Firebird stores time in a TIMESTAMP field with millisecond accuracy:
http://www.firebirdsql.org/file/documen ... stamp.html
Respectively, our driver takes into account this server specificity and allows to store milliseconds in TIMESTAMP fields. Therefore, if you need no milliseconds in the grid or any other controls, it is better to configure this in the settings of the controls.
http://www.firebirdsql.org/file/documen ... stamp.html
Respectively, our driver takes into account this server specificity and allows to store milliseconds in TIMESTAMP fields. Therefore, if you need no milliseconds in the grid or any other controls, it is better to configure this in the settings of the controls.
Re: Milliseconds are added to TimeStamp
Thank you very much for your support
I will use your piece of code to not have milliseconds.
Embarcadero DBXDriver is bugged in this case ...
and also the documentation, because now() shouldn't return milliseconds
Thanks
I will use your piece of code to not have milliseconds.
Embarcadero DBXDriver is bugged in this case ...
and also the documentation, because now() shouldn't return milliseconds
Thanks
Re: Milliseconds are added to TimeStamp
Feel free to contact us if you have any further questions about dbExpress driver for InterBase and Firebird.