How to convert NSDate into unix timestamp iphone sdk?
问题 How to convert an NSDate into Unix timestamp? I've read many posts which do the reverse. But I'm not finding anything related to my question. 回答1: I believe this is the NSDate's selector you're looking for: - (NSTimeInterval)timeIntervalSince1970 回答2: A Unix timestamp is the number of seconds since 00:00:00 UTC January 1, 1970. It's represented by the type time_t, which is usually a signed 32-bit integer type (long or int). iOS provides -(NSTimeInterval)timeIntervalSince1970 for NSDate