Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>NSCalendar *Calander = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; NSDateComponents *comps = [[NSDateComponents alloc] init]; [dateFormat setDateFormat:@"dd"]; [comps setDay:[[dateFormat stringFromDate:[NSDate date]] intValue]]; [dateFormat setDateFormat:@"MM"]; [comps setMonth:[[dateFormat stringFromDate:[NSDate date]] intValue]]; [dateFormat setDateFormat:@"yyyy"]; [comps setYear:[[dateFormat stringFromDate:[NSDate date]] intValue]]; [dateFormat setDateFormat:@"HH"]; [comps setHour:05]; [dateFormat setDateFormat:@"mm"]; [comps setMinute:30]; NSDate *currentDate=[Calander dateFromComponents:comps]; NSLog(@"Current Date is :- '%@'",currentDate); [dateFormat setDateFormat:@"dd"]; [comps setDay:[[dateFormat stringFromDate:yourDate] intValue]]; [dateFormat setDateFormat:@"MM"]; [comps setMonth:[[dateFormat stringFromDate:yourDate] intValue]]; [dateFormat setDateFormat:@"yyyy"]; [comps setYear:[[dateFormat stringFromDate:yourDate] intValue]]; [dateFormat setDateFormat:@"HH"]; [comps setHour:05]; [dateFormat setDateFormat:@"mm"]; [comps setMinute:30]; NSDate *reminderDate=[Calander dateFromComponents:comps]; //NSLog(@"Current Date is :- '%@'",reminderDate); //NSLog(@"Current Date is :- '%@'",currentDate); NSTimeInterval ti = [reminderDate timeIntervalSinceDate:currentDate]; //NSLog(@"Time Interval is :- '%f'",ti); int days = ti/86400; [dateFormat release]; [Calander release]; [comps release]; </code></pre> <p>Hope It will work for you........</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload