sql - How do I create an updated "date" field using SQLITE 3? -


i writing program me keep track of day day life, , want 1 of fields "date" field automatically update. do in sqlite 3? like....

create table day_to_day( date field miles_ran integer food_eaten text ) 

how about:

create table day_to_day(  id integer primary key autoincrement,  t timestamp default current_timestamp  miles_ran integer  food_eaten text ); 

which give column called t type timestamp, alternative use this:

create table day_to_day(  id integer primary key autoincrement,  t date default (datetime('now','localtime')),  miles_ran integer  food_eaten text ); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -