問題描述
我正在處理來自客戶端的 SQLite 文件,發(fā)現(xiàn)一列標(biāo)記為 TIMESTAMP,我過去曾使用 10 位數(shù)的 php 時間戳,該文件的時間戳為左側(cè) 9 位數(shù),右側(cè) 6 位數(shù):
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
我不知道如何將這些數(shù)字轉(zhuǎn)換為日期時間或如何計算它們.有什么幫助嗎?謝謝.
I do not know how to convert this numbers to date-times or how are they calculated. Any help? Thanks.
推薦答案
我猜這是一個 Apple Core Data 時間戳,基于這個:
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
所以你可以使用上面的轉(zhuǎn)換成標(biāo)準(zhǔn)格式.
So you can use the above to convert to a standard format.
(另外,請查看 這個答案 .)
(Also, check out this answer .)
這篇關(guān)于SQLite 文件中的 9 位時間戳的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!