Sqlite writing date in email

I export the date value from sqlite and put it in an email. Date looks like this: 279498721.322872

I am using Objective C in an Iphone application. Does anyone know how to make this export as a normal date, whether 2009-02-10 or anything picky?

+3
source share
3 answers

Thanks for answers. The answer came from my Guru Alex Cone. He told me to use the following:

NSTimeInterval tempInterval = (NSTimeInterval)sqlite3_column_double(statement, 4);

Then the variable tempIntervalcan be loaded into the method NSDate.

+1
source

, 279498721.322872 NSDate, +dateWithTimeIntervalSinceReferenceDate, ( MDT): 2009-11-09 15:32:01 -0700, 4 . , , , NSDateFormatter.

, sqlite ( ) ( sql). , : " ?"

+2
echo date("Y-m-d",time(279498721.322872));
+1
source

Source: https://habr.com/ru/post/1722387/


All Articles