Andrew Andrew - 11 months ago 47
Objective-C Question

How do i add 1 day to a NSDate?

Basically, as the title says. I'm wondering how I could add 1 day to an


So if it were:

21st February 2011

It would become:

22nd February 2011

Or if it were:

31st December 2011

It would become:

1st January 2012.



This answer does not cover corner cases, for example: day-light savings, please see Zaky German's answer below for a better answer.

NSDate *now = [NSDate date];
int daysToAdd = 1;
NSDate *newDate1 = [now dateByAddingTimeInterval:60*60*24*daysToAdd];