i hav a two dates of type nsdate and i want to calculate the diff b/w the two dates as a mins/seconds finally...
how can i do it..
i hav a two dates of type nsdate and i want to calculate the diff b/w the two dates as a mins/seconds finally...
how can i do it..
 
    
    NSDate has a -timeIntervalSinceDate: method.
Therefore:
NSTimeInterval tval = [date1 timeIntervalSinceDate: date2];
int sec = tval % 60,
    min = tval - 60*sec;
 
    
     
    
    http://iphonedevelopment.blogspot.com/2009/07/category-on-nsdate.html
as you get the days you can convert into time.
But if you want exact difference , like if it is 1.5 days
you have to convert date into timestamp then find the difference
So Alexsander want to say you take this:
double difference = [date1 timeIntervalSinceDate:date2] / 60;
The difference is now in minutes.
