我有一个谓词,它返回所选日期的事件,但它返回一个具有不同时区的日期。如何使谓词根据当地时区搜索日期?
NSTimeInterval time = floor([[NSDate date] timeIntervalSinceReferenceDate] / 86400.0) * 86400.0;
NSDate *start = [NSDate dateWithTimeIntervalSinceReferenceDate:time];
NSTimeInterval secondsInTwentyFourHours = (24 * 60 * 60);
NSDate *end = [start dateByAddingTimeInterval:secondsInTwentyFourHours];
// Create the predicate from the event store's instance method
NSPredicate *predicate = [store predicateForEventsWithStartDate:start endDate:end calendars:nil];
// Fetch all events that match the predicate
events = [store eventsMatchingPredicate:predicate];