Difference between two NSDate objects — Result also a NSDate

后端 未结 5 1012
礼貌的吻别
礼貌的吻别 2020-11-30 20:38

I have two NSDate objects and I want the difference between the two and the result should again be a NSDate object. Any idea how to achieve this?

Here, I am trying t

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 20:54

    You can calculate the time interval between two dates using NSDate's timeIntervalSinceDate:, but it doesn't make any sense for you to represent a time interval as a date.

提交回复
热议问题