I have an NSDate object, and I need to check if it has already passed. If so, turn that date into the date of tomorrow, but I can’t lose information like TimeZone in the process.
Could you plz help me?
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.
NSDatehas no timezone info. It’s just a thin layer over the number of seconds elapsed since its epoch. You can use a calendar and a timezone to turn it into anNSDateComponents, fiddle with the date there, and then format that into a newNSDate.