views:

30

answers:

2

Hello All,

I need to check whether an entered date [ taking input from user in textfield] is past date or not.

Thanks,

Sagar

+1  A: 

Have a look at reference document
There are also earlierDate: and laterDate: and isEqualToDate:.

You can find the documentation on them here.

find something like:

if ([today laterDate:expDate] == expDate)
org.life.java
Note that `isEqualToDate:` is a very hard beast to use; unless the receiver and the argument are the same `NSDate` instance, it's doing a floating point comparison at its core so all of the standard caveats apply.
Barry Wark
A: 
  1. Convert to seconds the date and then compare.
  2. Use difftime if you can provide the parameters

There may be other methods too. Also the user should enter the time in the specified format. I would suggest to use a range of values using a drop down box or a spin widget.

Praveen S
Thanks Praveen for reply.
Sagar Mane