Sqlite and inserting dates without seconds

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Post Reply
podtalje
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 18.05.2014, 16:45

Sqlite and inserting dates without seconds

Post by podtalje »

The problem is when you insert datetime into sqlite and you don't use seconds, then there is no way to display time part of the datetime when retrieving data.

Description:

When you insert a new DateTime field and you don't use seconds, e.g.
insert into test values('2013-01-02 18:33')

This data is stored into database and I can see the date and time part in other tools for browsing sqlite databases.

The problem is if I request this data within Delphi program, I can only get the date part of the datetime. Time part is missing and there is no way to display it.

But if I insert the data in full format with HH:MM:SS, e.g.
insert into test values('2013-01-02 18:33:00')

Then the time part of the date is displayed correctly.

This was tested with Delphi 7 and Delphi XE2.

I would classify this as a bug because if the format without seconds is not correct, then this should trigger exception.

But since other database tools can display this info correctly, I would guess the problem is when retrieving the data back from database into Zeoslib.

P.S. I have also opened a ticket:
https://sourceforge.net/p/zeoslib/tickets/71/
Post Reply