RCarmody
RCarmody

Reputation: 720

SQLite Date Adjustment Incorrect

I am trying to convert my date (15768) to a normal format within SQLite Studio....

I have the following formula that works but it's giving me the incorrect end result (it puts it in 1967 rather than the mid-2010's)

DATETIME(ReportDate,'unixepoch','localtime') ReportDate

Is it also possible to convert this to just the date, not time?

Upvotes: 0

Views: 53

Answers (1)

forpas
forpas

Reputation: 164139

It might be the case that your 5 digit dates represent the number of days since 1970-01-01.
So you can try:

SELECT DATE('1970-01-01', ReportDate || ' day') ReportDate
FROM tablename

Result:

ReportDate
----------
2013-03-04

Upvotes: 1

Related Questions