I am use a FMDatabase in project, and my question is about selecting dates from database.
Sqlite wants dates as seconds from 1/1/1970, but I notice, that if we save date as date in database, and then select with method stringForColumn:
(not dateForColumn:
), it returns true date. Why is it so?
Asked
Active
Viewed 274 times
0

Troir1
- 63
- 3
- 9
1 Answers
0
You can not save data object in sqlite.. you have to convert NSDate to NSString useing NSDateFormater and save that string to sqlite.. And Also you can retrive NSDate Object from NSString Using NSDateFormater..

Bevin Patel
- 302
- 3
- 11
-
If I understand right, to save data we need: 1) Convert NSDate to NSString 2) Save this string to date or datetime column in sqlite 3) then, to get information from database we selecting this string by method stringForColumn? – Troir1 Apr 03 '15 at 08:21