How to convert NSDate into unix timestamp iphone sdk?

neha picture neha · Jun 8, 2010 · Viewed 142.8k times · Source

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.

Answer

BAndonovski picture BAndonovski · Jun 8, 2010

I believe this is the NSDate's selector you're looking for:

- (NSTimeInterval)timeIntervalSince1970