Search code examples
sqlitetimestampunix-timestamp

Timestamp with 9 digits in SQLite file


I am working on a SQLite file from a client and found a column marked as TIMESTAMP, I have work in the past with php timestamp with 10 digits, this file has time stamps with 9 digits to the left and 6 to the right:

570822838.260406
570822838.544408
570822846.167604

I do not know how to convert this numbers to date-times or how are they calculated. Any help? Thanks.


Solution

  • I'd guess it's an Apple Core Data timestamp, based on this:

    sqlite> select datetime(570822838.260406, 'unixepoch', '+31 years');
    2019-02-02 17:53:58
    

    So you can use the above to convert to a standard format.

    (Also, check out this answer .)