• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
adding days
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: adding days
      • From: Steve Mills <email@hidden>
  • Prev by Date: Why is the first of March a Tuesday
  • Next by Date: Re: Why is the first of March a Tuesday
  • Previous by thread: Re: Why is the first of March a Tuesday
  • Next by thread: Re: adding days
  • Index(es):
    • Date
    • Thread