I have two dates, one is in the UTC timezone and the other is in New Zealand. I need to compare if one date is greater than the other.
How do I do this? Do I need to convert them to the same timezone first?
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.
NSDates don’t have timezones. They represent absolute moments in time. As long as you made theNSDates correctly — i.e., if you created them via anNSDateFormatter, it has a timezone that needs to be set — you can compare them directly.