Alex Rivera | Logout

How do I determine whether an NSDate (including time) has passed

Asked 2012-01-05T16:30:12.023
23

How do I determine whether an NSDate (including time) has passed? I need to basically compare today's date to a date in the db but am stumped.

Edit
Report

1 Answer

92

Try this:

if ([someDate timeIntervalSinceNow] < 0.0) {
    // Date has passed
}
answered 2012-01-05T16:33:30.610

Your Answer