比较两个NSDates [英] Compare two NSDates
本文介绍了比较两个NSDates的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何比较两个NSDates并返回它们之间的时间量。
How can I compare two NSDates and return the amount of time between them.
例如:
2010-06-20 14:29:41 -0400
2010-06-20 14:53:29 -0400
应返回类似于 23
或 24
推荐答案
尝试类似:
int intervall = (int) [date1 timeIntervalSinceDate: date2] / 60;
这篇关于比较两个NSDates的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文