0

From Android, I am reading SQLite3 Databases initially created from iOS (via NSDate). I can read the tables and values just fine, but there is a TIMESTAMP issue...

A TIMESTAMP field shows a numeric value, when viewed SQLite Database Browser. For example, the value of 385192800 is found in the database, which I believe corresponds to Sun March 17 2013, 6:00 AM UTC/GMT+0.

How can I interpret this date for Android (Java)? Typcially, timestamps should be the number of seconds (or even milliseconds) from 1970-01-01. This date is not even close...

When I issue the query below, I get "1982-03-16"...

SELECT strftime('%Y-%m-%d', datetime(385192800, 'unixepoch')) AS somedate 
FROM SOMETABLE LIMIT 1

It must not be a typical unix timestamp.. What does iOS's NSDate do, when persisting to SQLite3?

MiStr
  • 1,193
  • 10
  • 17

1 Answers1

2

Core data stores timestamps based on the reference date, which is 1st Jan 2001. See this discussion for more information.

PS: Your question does not mention the year of the timestamp that you have specified.

Community
  • 1
  • 1