If I want to use the compare method to compare two days:
[day1 compare:day2] == NSOrderedAscending
How to compare only by year-month-day?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are 86400 seconds in a day, so if you get the number of seconds since a reference date for both dates, you can divide them by 86400 and compare the two numbers.
This will give you (in
days1anddays2) the number of days for the dates that have passed since January 1st, 1970. You can then compare them.