ZPUBLICATIONDATETIME
is of type TIMESTAMP
.
So when I do this:
SELECT strftime('%d - %m - %Y ', datetime(ZPUBLICATIONDATETIME, 'unixepoch')) FROM ZTNNEWS;
I get 26 - 05 - 1984
instead of 2015. iOS (Core Data) writes datetime on 1 Jan 2001
based. What is the best approach to get the right date conversion?
Shall I just add 31 years to it or is there an alternative to unixepoch
to put in there?
Essentially what I am trying to do is to get the records from past two days:
select *
from ZTNNEWS
where DATETIME(ZPUBLICATIONDATETIME) > DATETIME('now', '-2 day')
But because ZPUBLICATIONDATETIME
is of type TIMESTAMP
rather than Datetime, it doesn't output anything.
Any advice please?
Aucun commentaire:
Enregistrer un commentaire