how to add time in current time

后端 未结 4 2234
清歌不尽
清歌不尽 2021-02-14 07:01

I\'m quite confused about this one.

I want to grab, current time, than according to condition, I want to add the required time, to the current time. for example.

4条回答
  •  深忆病人
    2021-02-14 07:45

    'addTimeInterval:' is deprecated
    

    You can use this now

    mydate=[NSDate date];    
    mydate = [mydate dateByAddingTimeInterval:XXX]; //XXX in seconds
    

提交回复
热议问题