SQLite: Default a datetime field to the current time (now)
Briefly

Just use the SQLite current_timestamp function to default a datetime field to current date/time: 'last_updated datetime default current_timestamp'.
You can use current_timestamp multiple times in a single SQLite 'create table' statement, unlike MySQL.
The key to default fields in SQLite is to skip them during SQL INSERT operations.
Read at Alvinalexander
[
|
]