我正在处理来自客户端的 SQLite 文件,发现一列标记为 TIMESTAMP,我过去曾使用 10 位数的 php 时间戳,该文件的时间戳为左侧 9 位数,右侧 6 位数:
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.
我猜这是一个 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
所以你可以使用上面的转换成标准格式.
So you can use the above to convert to a standard format.
(另外,请查看 这个答案 .)
(Also, check out this answer .)
这篇关于SQLite 文件中的 9 位时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
动态创建占位符以在 SQLite 表中为一行插入多个列Dynamically creating a placeholder to insert many column values for a row in SQLite table(动态创建占位符以在 SQLite 表中为一行插入多个列
SQLite.Net-PCL 如何处理 UTC 时间How SQLite.Net-PCL handle UTC time(SQLite.Net-PCL 如何处理 UTC 时间)
如何在 C 中正确地进行 SQLite SELECT 查询?How to make SQLite SELECT query in C correctly?(如何在 C 中正确地进行 SQLite SELECT 查询?)
如何显示来自 mysql 的最后 10 分钟旧记录How to show last 10 min old records from mysql(如何显示来自 mysql 的最后 10 分钟旧记录)
将 Oracle DATE 转换为 Unix 风格的时间(自 1906 年以来Convert Oracle DATE to Unix-style time (seconds since 1906?)(将 Oracle DATE 转换为 Unix 风格的时间(自 1906 年以来的秒数?))
替换 SQLite DB 中的路径字符串导致意外违反唯一约Replace path string in SQLite DB causes unexpected violated unique constraint(替换 SQLite DB 中的路径字符串导致意外违反唯一约束)