以下是我的代码: -
-(NSDate *)getReminderDatetime
{
NSArray *tempStrings = [self.selectedReminderInfo.reminderTime componentsSeparatedByString:@":"];
NSInteger hour = [[tempStrings firstObject] integerValue];
NSInteger min = [[tempStrings lastObject] integerValue];
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier: NSCalendarIdentifierGregorian];
NSDate *reminderDate = [calendar dateBySettingHour:hour minute:min second:0 ofDate:self.selectedDate options:0];
//reminderDate = [GeneralHelper convertToLocalTime:reminderDate];
return reminderDate;
}
hour is 15
和min is 29
的结果。所以右边的提醒日期应为2017-06-16 15:29:00 +0000
。但是,它返回-8小时,即2017-06-16 09:29:00 +0000
。如何将其修复为我想要的值?