title: Fetching events in specified time interval using Event Kit does not work as expected
body: <p>I am using Event Kit on iOS 4.3.1 to retrieve all of the events in a specified time interval.
  However, I am experiencing the following problems.</p>
  
  <p>1) using as start date [NSDate distantPast] and as end date [NSDate distantFuture] does not return any event.</p>
  
  <pre><code>    EKEventStore *store = [[EKEventStore alloc] init];
  
      // Create the predicate.
      NSPredicate *eventPredicate = [store predicateForEventsWithStartDate:[NSDate distantPast] endDate:[NSDate distantFuture] calendars:store.calendars]; 
  
      // Fetch all events that match the predicate.
      NSArray *events = [[store eventsMatchingPredicate:eventPredicate] retain];
  </code></pre>
  
  <p>2) Setting the start date to 10 years ago and the end date to 10 year from now only fetches events up to 2005. Nothing else is returned.</p>
  
  <pre><code>    EKEventStore *store = [[EKEventStore alloc] init];
  
      CFGregorianDate gregorianStartDate, gregorianEndDate;
      CFGregorianUnits startUnits = {-10, 0, 0, 0, 0, 0};
      CFGregorianUnits endUnits = {10, 0, 0, 0, 0, 0};
      CFTimeZoneRef timeZone = CFTimeZoneCopySystem();
  
      gregorianStartDate = CFAbsoluteTimeGetGregorianDate(
                                                          CFAbsoluteTimeAddGregorianUnits(CFAbsoluteTimeGetCurrent(), 
                                                          timeZone, 
                                                          startUnits),
                                                          timeZone);
      gregorianStartDate.hour = 0;
      gregorianStartDate.minute = 0;
      gregorianStartDate.second = 0;
  
      gregorianEndDate = CFAbsoluteTimeGetGregorianDate(
                                                        CFAbsoluteTimeAddGregorianUnits(CFAbsoluteTimeGetCurrent(), 
                                                        timeZone,
                                                        endUnits),
                                                        timeZone);
      gregorianEndDate.hour = 0;
      gregorianEndDate.minute = 0;
      gregorianEndDate.second = 0;
  
      NSDate* startDate =
      [NSDate dateWithTimeIntervalSinceReferenceDate:CFGregorianDateGetAbsoluteTime(gregorianStartDate, timeZone)];
      NSDate* endDate =
      [NSDate dateWithTimeIntervalSinceReferenceDate:CFGregorianDateGetAbsoluteTime(gregorianEndDate, timeZone)];
  
      CFRelease(timeZone);
  
      // Create the predicate.
      NSPredicate *eventPredicate = [store predicateForEventsWithStartDate:startDate endDate:endDate calendars:store.calendars]; 
  
      // Fetch all events that match the predicate.
      NSArray *events = [[store eventsMatchingPredicate:eventPredicate] retain];
  </code></pre>
  
  <p>So, I was wondering if the snippet of code posted is correct or if I am doing something wrong. Ideally I would like to use [NSDate distantPast] and  [NSDate distantFuture] to retrieve in a single call all of the events in all of the calendars. Is this actually possible? Also, since even the second example does not work (at least for me), what is the proper way to retrieve all of the events? Do I need multiple calls with a narrow time interval? If yes, what is the largest time interval once can use to retrieve the events?
  Thank you in advance.</p>