title: How to get time interval for every 30:00(30 minutes) from current time to 10:30 pm
body: <p>Need help to show the time intervals for every 30 mins, suppose the <code>current time is 11:45 am</code> then</p>
  
  <p>Time intervals should be : <code>12:00 pm,12:30 pm,01:00 pm,01:30 pm,02:00 pm,02:30 pm......10:30 pm.</code></p>
  
  <pre><code> NSString *time = @"10.30 pm";
  
       NSDate *date1;
          NSDate *date2;
          {
              NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
              [formatter setDateFormat:@"hh.mm a"];
              date1 = [formatter dateFromString:time];
              date2 = [formatter dateFromString:[formatter stringFromDate:[NSDate date]]];
  
          }
          NSTimeInterval interval = [date1 timeIntervalSinceDate: date2];//[date1 timeIntervalSince1970] - [date2 timeIntervalSince1970];
          int hour = interval / 3600;
          int minute = (int)interval % 3600 / 60;
  
          NSLog(@"%@ %dh %dm", interval&lt;0?@"-":@"+", ABS(hour), ABS(minute));
  </code></pre>
  
  <p>This code returns me difference of current time and the given time how can I proceed further. </p>