SQLite Current Timestamp with Milliseconds?

后端 未结 4 1771
感动是毒
感动是毒 2020-12-29 04:57

I am storing a timestamp field in a SQLite3 column as TIMESTAMP DATETIME DEFAULT CURRENT_TIMESTAMP and I was wondering if there was any way for it to include mi

4条回答
  •  孤城傲影
    2020-12-29 05:35

    To get number of milliseconds since epoch you can use julianday() with some additional calculations:

    -- Julian time to Epoch MS     
    SELECT CAST((julianday('now') - 2440587.5)*86400000 AS INTEGER); 
    

提交回复
热议问题