Kasam
Kasam

Reputation: 29

What type of date format is this? And how to convert it?

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.

Example of date/time codes:

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.

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

Upvotes: 1

Views: 272

Answers (1)

Schwern
Schwern

Reputation: 164699

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

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

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

Upvotes: 3

Related Questions