Lazarus

Programming => Databases => Topic started by: eden159 on January 20, 2007, 03:44:37 pm

Title: ZEOS, Firebird and TDateTime field problem
Post by: eden159 on January 20, 2007, 03:44:37 pm
Hi,

I came accross the following problem:
I have a table with a field "tick_time" of type DateTime. I have a record with the following date/time - 01/18/2007 00:00:10.

From Lazarus I make the following query using the Zeos query component:
Code: [Select]

SELECT * FROM my_table WHERE tick_time='01/18/2007 00:00:10'

I have one record returned - the exact count of records with that exact date/time.

Then I try to convert the extracted "tick_time" and show it to the user:
Code: [Select]

DateTimeToString(TickString, 'MM/dd/yyyy hh:mm:ss', Query.FieldByName('tick_time').AsDateTime);
ShowMessage(TickString);

The shown value is not 01/18/2007 00:00:10, but 01/18/2007 00:00:09!

When I try it for any other time (the date does not matter), for example 00:00:20 - it works fine.

Does anyone have this bug? Is it a bug or am I missing something?
TinyPortal © 2005-2018