Problems with Time and DateTime Fields
Posted: 09.08.2007, 09:37
Hi all,
I'm working with Lazarus 0.9.20 Beta and Zeos lib 6.6.1Beta on a Debian System. Database server is a Mysql 5.0.32.
Storing a date and a time in a DateTime field works ok. But if I read it with ZQuery1.fieldByName('startTime').asString I get the time minus one minute.
Example:
The date time in the database is '2007-08-15 11:00:00'
but I get following '2007-08-15 10:59'
Unfortunately I cannot reproduce it all the time but I can say that it happens independent of the function (asString, asDateTime) with DateTime-fields and Time-Fields.
Until now I wasn't able to test it with several mysql versions or older/newer versions of zeos lib or Lazarus. I searched several forums and "googled" several days but without any result. So I'm really sorry, if the mistake is on me, missing something important.
I hope someone has a solution or an idea because it is really annoying for me to use varchar fields for storing of dates and/or times
Peter
I'm working with Lazarus 0.9.20 Beta and Zeos lib 6.6.1Beta on a Debian System. Database server is a Mysql 5.0.32.
Storing a date and a time in a DateTime field works ok. But if I read it with ZQuery1.fieldByName('startTime').asString I get the time minus one minute.
Example:
The date time in the database is '2007-08-15 11:00:00'
but I get following '2007-08-15 10:59'
Unfortunately I cannot reproduce it all the time but I can say that it happens independent of the function (asString, asDateTime) with DateTime-fields and Time-Fields.
Until now I wasn't able to test it with several mysql versions or older/newer versions of zeos lib or Lazarus. I searched several forums and "googled" several days but without any result. So I'm really sorry, if the mistake is on me, missing something important.
I hope someone has a solution or an idea because it is really annoying for me to use varchar fields for storing of dates and/or times
Peter