Assume the date is valid.
NSDateFormatter *dateF = [[NSDateFormatter alloc] init];
[dateF setDateStyle:NSDateFormatterFullStyle];
NSDate *todayDate = [dateF dateFromString: @"5-MAY-2011 00:00:00 +0000"];
NSTimeInterval inter = [todayDate timeIntervalSince1970];
See the manual and NSDateFormatter for more information .
source
share