On Mar 25, 2016, at 10:52 AM, "Gerriet M. Denkmann" <[email protected]> 
wrote:

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?

Don't use NSCalendarWrapComponents. 

Sent from iCloud's ridiculous UI, so, sorry about the formatting

 
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]
  • adding days Gerriet M. Denkmann
    • Re: adding days Steve Mills

Reply via email to