NSTimeInterval to NSDate

后端 未结 7 1488
逝去的感伤
逝去的感伤 2020-12-01 16:18

How can I convert a NSTimeInterval to NSDate? Think of it like a stopwatch. I want the initial date to be 00:00:00, and I have a NSTimeInterv

7条回答
  •  攒了一身酷
    2020-12-01 17:04

    NSTimeInterval to NSDate conversion in Swift:

    let timeInterval = NSDate.timeIntervalSinceReferenceDate() // this is the time interval
    NSDate(timeIntervalSinceReferenceDate: timeInterval)
    

提交回复
热议问题