当前时间加20分钟

NSDate *dates = [self.datePickerView date];

NSTimeInterval interval = 20 * 60;

NSDate *detea = [NSDate dateWithTimeInterval:interval sinceDate:dates];

NSDateFormatter  *dateformatter=[[NSDateFormatter alloc] init];

[dateformatter setDateFormat:@"yyyyMMddHHmm"];

NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"BeiJing"];

[dateformatter setTimeZone:timeZone];

NSString *  locationString=[dateformatter stringFromDate:detea];

return locationString;

你可能感兴趣的:(当前时间加20分钟)