How can I calculate the days between 1 Jan 2010 and (for example) 3 Feb 2010?
Share
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.
EDIT:
Remember,
NSDateobjects represent exact moments of time, they do not have any associated time-zone information. When you convert a string to a date using e.g. anNSDateFormatter, theNSDateFormatterconverts the time from the configured timezone. Therefore, the number of seconds between twoNSDateobjects will always be time-zone-agnostic.Furthermore, this documentation specifies that Cocoa’s implementation of time does not account for leap seconds, so if you require such accuracy, you will need to roll your own implementation.