views:

182

answers:

2

hi i need to countdown dates not times

how to run countdown with dates to count days in iphone sdk

A: 
NSDate future = [NSDate dateWithString:@"2010-08-30 00:00:00 +0000"];
NSDate past = [NSDate dateWithString:@"2010-03-15 00:00:00 +0000"];

int days = [future timeIntervalSinceDate:past] / 86400;
Frank Schmitt
A: 

i understand how doto it

NSDate *future = dp.date;   // This is date picker
NSDate *past = [NSDate date];  //today date

int days = [future timeIntervalSinceDate:past] / 86400;


NSLog(@"%d",days);

Thanks Frank you help me to understand my mistake