c time_t 和 oc NSDate 的转换
c time_t 和 oc NSDate 的转换
1:time_t 转 oc NSDate
time_t some_time_t=NULL;
NSDate *someDate = [NSDate dateWithTimeIntervalSince1970:some_time_t];
2: NSDate 转 time_t
time_t unixTime = (time_t) [[NSDate date] timeIntervalSince1970]; - (NSTimeInterval)timeIntervalSince1970
参考:http://stackoverflow.com/questions/2997062/how-to-convert-nsdate-into-unix-timestamp-iphone-sdk
http://stackoverflow.com/questions/2954733/converting-a-time-t-to-nsdate-object