开发者

Comparing time in NSDate

开发者 https://www.devze.com 2023-01-17 17:47 出处:网络
I am trying to compare the time from two NSDate objects but am getting the wrong answer. I think it is because when using the 开发者_高级运维NSDate compare methods it is also including the date. I jus

I am trying to compare the time from two NSDate objects but am getting the wrong answer. I think it is because when using the 开发者_高级运维NSDate compare methods it is also including the date. I just want to ignore the date and compare the times. How can this be done?


well, you can always use NSCalendar's - (NSDate *)dateFromComponents:(NSDateComponents *)comps

0

精彩评论

暂无评论...
验证码 换一张
取 消