Date format does not display correctly until the app is closed and opened
I am working on a simple database application in Delphi using FireDAC and SQLite3. Whenever I insert a new record into the database, the date format that is displayed on my form is always in the format yyyy-mm-dd
, and as soon as I close and reopen the application, the format changes to m/d/yyyy
which is the format I expected and want always show up without closing and reopening my app.
The parameters and definition parameters for the FireDAC connection are by default. The DataType for the field containing the date in the SQLite3 database is set to DATE
. Finally, the code I am using to insert the post is below.
Qry.SQL.Text := 'INSERT INTO employees (HireDate) VALUES (:HiredOn)';
Qry.ParamByName('HiredOn').AsDate := DateTimePicker1.Date;
Qry.ExecSQL;
Qry.Open('SELECT * FROM employees');
Any help would be appreciated.
source to share