Re: Calculate next occurrence of a NSDate
Re: Calculate next occurrence of a NSDate
- Subject: Re: Calculate next occurrence of a NSDate
- From: WT <email@hidden>
- Date: Fri, 31 Dec 2010 12:46:03 -0200
On Dec 31, 2010, at 12:24 PM, Ken Thomases wrote:
> On Dec 31, 2010, at 7:22 AM, WT wrote:
>
>> The following is straight out of my code, and computes the next Wed or Sat from a given date.
>
> Computing days by calculating the number of seconds in a day will fail when crossing into or out of Daylight Saving Time.
>
> Use -[NSCalendar dateByAddingComponents:toDate:options:] as shown in the documentation.
>
> Regards,
> Ken
That's an excellent point, Ken, and one which hadn't occurred to me before. Thanks for pointing that out.
WT_______________________________________________
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