Look at: http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions
Alternatively, you could use the c library's time() or gettimeofday() and store the result in an INTEGER column (which in sqlite can hold 64-bit values, if you need the full resolution from gettimeofday).
In either case, remember to think about localtime vs. UTC. Doug Hanks wrote:
Hello, I would like to use the sqlite3_bind_* functions to bind data to a TIMESTAMP column. With regular SQL I can use the following command: INSERT INTO TABLE (completed) VALUES(date('now')); The data('now') function returns the current date. What is the correct method in the C API to have the same functionality? If there is a better way to handle timestamps perhaps with another column type, please let me know. I am flexible. -- - Doug Hanks = dhanks(at)gmail(dot)com