问题
In instagram
API,I got the below response
"created_time" = 1379598284;
I want to convert the created_time
to NSDate
please help me
回答1:
use this
NSDate *date = [NSDate dateWithTimeIntervalSince1970:(ms / 1000.0)];
回答2:
simple try this...
NSDate* date = [NSDate dateWithTimeIntervalSince1970:yourtime];
Happy Coding
回答3:
try this... as per follow to decode to date
NSDate *tr = [NSDate dateWithTimeIntervalSince1970:1379598284];
or
NSDate *tr = [NSDate dateWithTimeIntervalSinceReferenceDate:1379598284];
OR
NSDate *tr = [NSDate dateWithTimeIntervalSinceNow:1379598284];
回答4:
This is "2013-09-19 13:44:44 +0000" Try following line of code.
NSDate *date = [NSDate dateWithTimeIntervalSince1970:1379598284];
来源:https://stackoverflow.com/questions/18913601/how-to-convert-a-milliseconds-to-nsdate-in-objective-c