How to convert NSTimeInterval to int?

前端 未结 6 634
我寻月下人不归
我寻月下人不归 2021-01-03 17:47

How do I convert NSTimeInterval into an Integer value?

My TimeInterval holds the value 83.01837. I need to convert it into 83. I have googl

6条回答
  •  长发绾君心
    2021-01-03 18:37

    I had a need to store an NSDate in a Swift Number. I used the following cast which is working great.

    Double(startDateTime.timeIntervalSince1970)
    

提交回复
热议问题