SQLite 文件中的 9 位时间戳 [英] Timestamp with 9 digits in SQLite file

查看:40
本文介绍了SQLite 文件中的 9 位时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理来自客户端的 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 位时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆