How to compare two dates in Objective-C

Cocoa has couple of methods for this: in NSDate – isEqualToDate: – earlierDate: – laterDate: – compare: When you use – (NSComparisonResult)compare:(NSDate *)anotherDate ,you get back one of these: The receiver and anotherDate are exactly equal to each other, NSOrderedSame The receiver is later in time than anotherDate, NSOrderedDescending The receiver is earlier in time … Read more

How to compare two dates in Objective-C

Cocoa has couple of methods for this: in NSDate – isEqualToDate: – earlierDate: – laterDate: – compare: When you use – (NSComparisonResult)compare:(NSDate *)anotherDate ,you get back one of these: The receiver and anotherDate are exactly equal to each other, NSOrderedSame The receiver is later in time than anotherDate, NSOrderedDescending The receiver is earlier in time … Read more

Comparing Dates in Oracle SQL

31-DEC-95 isn’t a string, nor is 20-JUN-94. They’re numbers with some extra stuff added on the end. This should be ’31-DEC-95′ or ’20-JUN-94′ – note the single quote, ‘. This will enable you to do a string comparison. However, you’re not doing a string comparison; you’re doing a date comparison. You should transform your string … Read more