I need to get the current date.
Then add a year to it.
And output the result in the format YYYY-MM-DD aka 2011-11-20
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.
You will want to make use of NSCalendar and NSDateComponents in order to perform what you’re after. Something like the following should do the trick.
To then output the target date as a string in the format specified, you can do the following;
Hope this helps.