In My application I have to complete a particular task in given time.So first i calculated the time complete the task in seconds and then add that time to the current that like this.
NSDate *mydate = [NSDate date];
NSTimeInterval TotalDuraionInSec = sec.cal_time * 60;
TaskCmpltTime = [mydate addTimeInterval:TotalDuraionInSec];
NSLog(@"task will be completed at%@",TaskCmpltTime);
now I compare time like this
if([CurrentTime isEqualToDate:AfterCmpltTime]){
NSLog (@"Time Finish");
}
but I want to know is Time is left or not.Is current time is less then or greater then current time how can i know this ?
I have an example where I get the time from a picker and check if its today or tomorrow. You should be able to just take the code and use it in your way…