sqlitecurrent-time

sqlite: how to select current_timestamp as millisecond value since 1/1/1970


sqlite> select typeof(date('now'));
text
sqlite> select typeof(current_time);
text
sqlite> select typeof(current_date);
text

How to select the current date/time as an integer value of milliseconds since Jan/1/1970?


Solution

  • strftime() gives you only seconds:

    SELECT strftime('%s', 'now') * 1000;