这是什么类型的日期格式?以及如何转换呢? [英] What type of date format is this? And how to convert it?

查看:111
本文介绍了这是什么类型的日期格式?以及如何转换呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个名为Memo Lite的旧iOS应用程序使用的SQL数据库中发现了奇怪的日期代码。该列标记为LMT,可能是上次修改时间的缩写。它们是如何构造的,以及如何将其转换为可读格式,例如yyyy-mm-dd HH:mm:ss?
我知道Unix时间和Google Sheets如何处理时间。

I found strange date codes in a SQL database used by an old iOS app called Memo Lite. The column was labeled LMT, that might be an abbreviation for last modified time. How are they constructed and how can they be converted to readable formats, like yyyy-mm-dd HH:mm:ss? I am aware of both Unix time and how Google Sheets handles time.

日期/时间代码示例:

357931095.942149 = 2012-05-05
330432567.859129 = 2011-06-22
293964817.803674 = 2010-04-26

我不知道该格式是否有时间,看起来是这样,但未在应用程序中显示。

I don't know if the format has time, it looks so but it is not showed in the app.

日期/时间格式代码,参考示例:
https://support.google.com/docs / answer / 3094139?hl = zh_CN

Date/time format codes, reference example: https://support.google.com/docs/answer/3094139?hl=en

推荐答案

一些数学运算表明,距纪元已过去数秒。不是通常的1970-01-01,而是2001-01-01。

A little math shows it's seconds since an epoch. Not the usual 1970-01-01, but 2001-01-01.

  • 2001-01-01 + 293964817 seconds = 2010-04-25 08:53:37
  • 2001-01-01 + 330432567 seconds = 2011-06-22 10:49:27
  • 2001-01-01 + 357931095 seconds = 2012-05-05 17:18:15

小数部分为微秒。例如,293964817.803674是2010-04-25 08:53:37.803674。

The decimal portion is microseconds. For example, 293964817.803674 is 2010-04-25 08:53:37.803674.

您提到这是一个iOS应用,因此很可能 CFAbsoluteTime

You mentioned it's an iOS app, so it's likely CFAbsoluteTime.

这篇关于这是什么类型的日期格式?以及如何转换呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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