I want to get diff seconds between NSDate. I used [NSDate timeIntervalSinceDate] methods, but it returns always zero. Below is my code.
NSLog(@"sent date : %@", message.sentDate);
NSLog(@"prev: %@", _previousShownSentDate);
NSLog(@"%d", [message.sentDate timeIntervalSinceDate:_previousShownSentDate]);
In here, message.sentDate, _repviousShownSentDate are NSDate object.
But In logs, the difference seconds are always zero.
[1363:907] sent date : 2013-05-16 01:36:22 +0000
[1363:907] prev: 2013-05-16 01:36:17 +0000
[1363:907] 0
[1363:907] sent date : 2013-05-16 01:36:25 +0000
[1363:907] prev: 2013-05-16 01:36:17 +0000
[1363:907] 0
The third log line must be 5 (01:36:22 and 01:36:17). but it is zero.
I don't understand what i do mistake.