Modifying NSDate to represent 1 month from today

Posted by bmalicoat on Stack Overflow See other posts from Stack Overflow or by bmalicoat
Published on 2008-10-09T03:00:30Z Indexed on 2010/04/05 5:03 UTC
Read the original article Hit count: 310

Filed under:
|
|

I'm adding repeating events to a Cocoa app I'm working on. I have repeat every day and week fine because I can define these mathematically (3600*24*7 = 1 week). I use the following code to modify the date:

[NSDate dateWithTimeIntervalSinceNow:(3600*24*7*(weeks))]

I know how many months have passed since the event was repeated but I can't figure out how to make an NSDate object that represents 1 month/3 months/6 months/9 months into the future. Ideally I want the user to say repeat monthly starting Oct. 14 and it will repeat the 14th of every month.

© Stack Overflow or respective owner

Related posts about nsdate

Related posts about cocoa