sqlite database default time value ‘now’

Is it possible in a sqlite database to craete a table that has a timestamp column that default to DATETIME('now') ?

Like this:

CREATE TABLE test (
    id INTEGER PRIMARY KEY AUTOINCREMENT, 
    t TIMESTAMP DEFAULT DATETIME('now')
);

This gives an error… How to resolve?

9 Answers
9

Leave a Comment