How do you obtain the current timestamp in Sqlite? current_time, current_date, current_timestamp both return formatted dates, instead of a long.
sqlite> insert into events (timestamp) values (current_timestamp); sqlite> insert into events (timestamp) values (current_date); sqlite> insert into events (timestamp) values (current_time); sqlite> select * from events; 1|2010-09-11 23:18:38 2|2010-09-11 3|23:18:51
What I want:
4|23234232
The docs mention this method:
SELECT strftime('%s', 'now'); 1284248196
And this one which includes the fractional part:
SELECT (julianday('now') - 2440587.5) * 86400.0; 1284248196.65098
Both represent Unix Time, the number of seconds passed since January 1, 1970.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With