计算两个NSDate是否处于同一天

计算两个NSDate是否处于同一天的算法,无需使用calendar接口,无需format为字符串,兼容时区:

1 double timezoneFix = [NSTimeZone localTimeZone].secondsFromGMT;
2 if (
3     (int)(([nowDate timeIntervalSince1970] + timezoneFix)/(24*3600)) -
4     (int)(([lastDate timeIntervalSince1970] + timezoneFix)/(24*3600))
5     == 0)
6 {
7     return YES;
8 }
原文地址:https://www.cnblogs.com/spring286/p/4203608.html