About DATETIME with fractional seconds

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
RNOVAK
Posts: 26
Joined: Sat 19 Feb 2011 18:30
Contact:

About DATETIME with fractional seconds

Post by RNOVAK » Wed 16 Apr 2014 16:26

About new support to Fractional seconds in Time Values of MySQL 5.6/5.7

Since MySQL 5.6.4, there is support to DATETIME as '2014-02-02 10:05:45.123456'.

Example:
CREATE TABLE `mytest` (
`dt_hr_id` DATETIME(3) NOT NULL,
PRIMARY KEY (`dt_hr_id`)
);

Using the MyDAC... 'SELECT * from mytest;'
...
if DateTime '2014-02-02 10:05:45.123'.
ShowMessage(FormatDateTime('hh:nn:ss.zzz' ,MyQuery.Fields[0].AsDateTime));
shows '10:05:45.000' ...

I know about some limitations of Delphi, but above, why it shows '.000' ?
Is there a way to use it with MyDAC without use of MICROSECOND() of MySQL ?

Roberto

PavloP
Devart Team
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: About DATETIME with fractional seconds

Post by PavloP » Fri 18 Apr 2014 10:35

Thank you for your request.
We will investigate the possibility of adding this functionality in one of the next MyDAC versions.

Post Reply