NSDate *newDate=[newDate dateByAddingTimeInterval:difference];
Now I want to convert this newDate to NStimeInterval.
How can I do this conversion?
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.
NDDateandNSTimeIntervalare two diferent things, you cannot convert aNSDateto aNSTimeIntervaland vice-versa.NSDaterepresents an absolute date andNSTimeIntervalrepresents the time between two dates.However you can create a NSTimeInterval from a reference date with this method:
You can do it like this: