adding days
adding days
- Subject: adding days
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Fri, 25 Mar 2016 22:52:02 +0700
Please ignore previous post.
NSDate *nextTh = [ currentCalendar dateByAddingUnit: NSCalendarUnitDay
value: 7
toDate: now
options: NSCalendarWrapComponents
];
NSLog(@“%s now + %zd days = %@",__FUNCTION__, addDay, [self timerStringFor: nextTh]);
prints:
now + 7 days = Tue 01 Mar 2016 22:35:33 +0700 (which is indeed a Tuesday)
But I expected now ( 25. Mar 2016) + 7 days = 1st of April (which is a Friday).
How to make NSCalendar work as intended?
Gerriet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden