在Windows上翻译sqlite3时间戳格式

时间:2021-11-27 05:33:21

Sorry if this sounds like a puzzle, but it does have puzzling me for a while. :)

对不起,如果这听起来像一个谜,但它确实让我困惑了一段时间。:)

From a sqlite3 db file, one of the record has last_visit_time field of value 13010301178000000 (INTEGER type).

在sqlite3 db文件中,一条记录有last_visit_time字段,值为13010301178000000 (INTEGER type)。

How come 13010301178000000 = 4/12/2013 9:32:58PM? (4/12/2013 9:32:58PM is got by an existing tool, which I know nothing about how it translates internally).

为什么13010301178000000 = 4/12/2013 9:32:58PM?(2013年4月12日9点32分58分,我用的是一个现有的工具,我不知道它是如何在内部翻译的)。

Can someone shed some light on how this is translated?

有人能解释一下这是怎么翻译的吗?

I've looked at http://www.epochconverter.com/, but had no luck.

我看过http://www.epochconverter.com/,但运气不佳。

Thanks.

谢谢。

1 个解决方案

#1


3  

January 1, 1601 is the epoch for Windows timestamps.

1601年1月1日是Windows时间戳的时代。

However, those timestamps use 100-nanosecond intervals, so it appears your value got divided by 10, or you're missing a zero for some reason.

然而,这些时间戳使用100纳秒的间隔,所以看起来你的值被10除了,或者由于某种原因你丢失了一个0。

To convert to/from Unix timestamps, divide/multiply by 1000000 to convert between second and microseconds, and adjust be the offset between 1970 and 1601 in seconds.

要转换到/从Unix时间戳,请将/乘以1000000在秒和微秒之间转换,并调整为1970年和1601秒之间的偏移量。

#1


3  

January 1, 1601 is the epoch for Windows timestamps.

1601年1月1日是Windows时间戳的时代。

However, those timestamps use 100-nanosecond intervals, so it appears your value got divided by 10, or you're missing a zero for some reason.

然而,这些时间戳使用100纳秒的间隔,所以看起来你的值被10除了,或者由于某种原因你丢失了一个0。

To convert to/from Unix timestamps, divide/multiply by 1000000 to convert between second and microseconds, and adjust be the offset between 1970 and 1601 in seconds.

要转换到/从Unix时间戳,请将/乘以1000000在秒和微秒之间转换,并调整为1970年和1601秒之间的偏移量。