how can I add one minutes in current NSDate of iphone and save in NSDate?

前端 未结 2 884
长情又很酷
长情又很酷 2021-01-17 11:15

I can get current date of iphone via this code as

NSDate *currentDate = [NSDate date];
NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init];
[da         


        
2条回答
  •  死守一世寂寞
    2021-01-17 11:40

    You can use dateByAddingTimeInterval.

    NSDate *currentDate = [NSDate date];
    NSDate *datePlusOneMinute = [currentDate dateByAddingTimeInterval:60]; 
    //60 seconds
    

提交回复
热议问题