Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Karlsson87

macrumors newbie
Original poster
Mar 5, 2010
3
0
Hi,


i compare 2 dates with NSComparisonResult. If one of the date is in the past, now or in the future i get with NSOrderedDescending, NSOrderedSame etc.

But i need the value of NSComparisonResult, because i have to know how many days are between the dates.

Does anybody knows how to get the value?


Thanks,


Flo
 

bredell

macrumors regular
Mar 30, 2008
127
1
Uppsala, Sweden
Convert the two dates into numbers using the timeIntervalSinceReferenceDate method. Then you can simply subtract them to get the difference measured in seconds.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.