Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS Aurelius
Changing the way Aurelius saves dates in SQLite database

By default, Aurelius saves date values in SQLite as native Delphi TDateTime values, i.e., as double (float) values. This works fine if you are only using Aurelius to access the SQLite database. But if you have a legacy SQLite database or want other applications to read the database directly, you might need to use a different format. Aurelius offers two other alternative formats, which is Julian (saves the date values as Julian date times) or Text (which saves in text format “yyyy-mm-dd”).

To do that, add this code to the beginning of your application (choose the date time you want and uncomment the correct line).
Uses
 Aurelius.Sql.SQLite, Aurelius.Sql.Register;

Var
 SQLiteGenerator: TSQLiteSQLGenerator;
begin
 SQLiteGenerator := TSQLiteSQLGenerator.Create; 
//  SQLiteGenerator.DateType := TSQLiteSQLGenerator.TDateType.Delphi;
//  SQLiteGenerator.DateType := TSQLiteSQLGenerator.TDateType.Julian;
 SQLiteGenerator.DateType := TSQLiteSQLGenerator.TDateType.Text;
 TSQLGeneratorRegister.GetInstance.RegisterGenerator(SQLiteGenerator);