I have the following code in my program:
NSUInteger currentMinuteOrdinal = [[NSCalendar currentCalendar] ordinalityOfUnit:NSMinuteCalendarUnit inUnit:NSEraCalendarUnit forDate:[NSDate date]];
NSUInteger passedInMinuteOrdinal = [[NSCalendar currentCalendar] ordinalityOfUnit:NSMinuteCalendarUnit inUnit:NSEraCalendarUnit forDate:passedInDate];
NSUInteger minuteDifference = currentMinuteOrdinal - passedInMinuteOrdinal;
The current time is today at 6:09pm. The passed-in time is today at 4:17pm. (I'm looking at the values in the debugger so I know these values are correct.) Yet these two ordinal values always come out to the same value, rendering the 'minuteDifference' as 0.
Does this method simply not work? Or am I doing something horribly wrong?
Thanks.