Re: adding days
Re: adding days
- Subject: Re: adding days
- From: Steve Mills <email@hidden>
- Date: Fri, 25 Mar 2016 16:02:36 +0000 (GMT)
On Mar 25, 2016, at 10:52 AM, "Gerriet M. Denkmann" <email@hidden> 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@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
References: | |
| >adding days (From: "Gerriet M. Denkmann" <email@hidden>) |