What's the best/easiest way to compare two times in Objective-C?
- by Andy
I've got a string representation of a time, like "11:13 AM." This was produced using an NSDateFormatter and the stringFromDate: method.
I'd like to compare this time to the current time, but when I use the dateFromString: method to turn the string back into a date, a year, month and day are added - which I don't want. I just need to know if right now is < or the time stored in the string.
What's going to be the best way to handle that? Thanks in advance for your help.