How to add minutes to current time in swift

前端 未结 10 1357
天涯浪人
天涯浪人 2020-11-27 03:10

I am new to Swift and am trying a scheduler. I have the start time selected and I need to add 5 minutes (or multiples of it) to the start time and display it in an UILabel?<

10条回答
  •  一向
    一向 (楼主)
    2020-11-27 03:40

    I think the simplest will be

    let minutes = Date(timeIntervalSinceNow:(minutes * 60.0))
    

提交回复
热议问题