Date/Time field problems in Lazarus
Posted: 21.11.2005, 23:01
In Lazarus 0.9.10 with a recent checkout of zeosdbo_rework, there seems to be a problem converting database date/datetime/timestamp/etc columns to TDateTime. The dates come out very strange indeed. To duplicate the problem:
- Grab the latest CVS of zeosdbo_rework and install into Lazarus (see the tutorial on the Lazarus wiki)
- Drop a TZConnection component on a form, fill in its Host, Port (3306), User, Password, Database, and Protocol properties to connect to an existing database. Then set Connected to true.
- Drop a TZTable component on the form and set its Connection property to the TZConnection component you just made. Select a table in the TableName property editor that has a DATETIME (MySQL) or Time/Date/Timestamp (PostgreSQL) type column in it. Then set Active to true.
- Drop a TDatasource component on the form and set its DataSet property to be the TZTable you just placed.
- Drop a TdbGrid component on the form and set its DataSource property to be the TDatasource you just dropped.
- Look at all the funny dates in the DATETIME column. Don't point, though, or they might feel bad.