SQlite : How to store ms in TTIme and TDateTime fields ?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

SQlite : How to store ms in TTIme and TDateTime fields ?

Post by swierzbicki » Tue 19 May 2015 08:22

Hello,

I've an issue with SQLite where milliseconds aren't stored into the database.
How can I store ms H in TTIme and TDateTime fields ?

Thank you

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: SQlite : How to store ms in TTIme and TDateTime fields ?

Post by AlexP » Tue 19 May 2015 09:40

Hello,

Below is a sample of using TimeStamp:

Code: Select all

CREATE TABLE T_TS(F_TS TIMESTAMP);
...
UniQuery.SQL.Text := 'SELECT * FROM T_TS';
UniQuery.Open;
UniQuery.Append;
UniQuery.FieldByName('F_TS').AsSQLTimeStamp := DateTimeToSQLTimeStamp(now);
UniQuery.Post;
ShowMessage(SQLTimeStampToStr('yyyy-MM-dd HH:mm:ss Z', UniQuery.FieldByName('F_TS').AsSQLTimeStamp);

Post Reply