Time comparisons in swift

后端 未结 4 1116
梦如初夏
梦如初夏 2020-12-09 20:54

Question:

I need to compare 2 times - the current time and a set one. If the set time is in the future, find out how many minutes remain until said future time.

4条回答
  •  盖世英雄少女心
    2020-12-09 21:39

    Use timeIntervalSinceDate of date on further date and pass the earlier date as parameter, this would give the time difference

提交回复
热议问题