• 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
Re: Why is the first of March a Tuesday
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is the first of March a Tuesday


  • Subject: Re: Why is the first of March a Tuesday
  • From: Clark Cox <email@hidden>
  • Date: Fri, 25 Mar 2016 09:14:48 -0700

> On Mar 25, 2016, at 09:09, Gerriet M. Denkmann <email@hidden> wrote:
>
>
>> On 25 Mar 2016, at 23:01, Clark Cox <email@hidden> wrote:
>>
>>>
>>> On Mar 25, 2016, at 08:43, Gerriet M. Denkmann <email@hidden> wrote:
>>>
>>> In my calendar 2016/3/1 is a Friday, but:
>>
>>
>> Something's wrong with your calendar then :). March 1, 2016 *is* a Tuesday:
>
> Yes, sorry for the noise.
> I was adding 7 days to today and got 1. of March but expected 1. of April. (see my post about adding days).
>
> Turns out that NSCalendarWrapComponents = “Specifies that the operation should use arithmetic for calendar addition.” is the wrong choice.

Yeah, that note in the documentation seems pretty strange to me. Probably worth a radar.

> Without using “arithmetic" (instead using divination ?) I get the expected result.
>
> Kind regards
>
> Gerriet.
>
>>
>> % cal
>>     March 2016
>> Su Mo Tu We Th Fr Sa
>>       1  2  3  4  5
>> 6  7  8  9 10 11 12
>> 13 14 15 16 17 18 19
>> 20 21 22 23 24 25 26
>> 27 28 29 30 31
>>
>>
>>>
>>> - (NSString *)timerStringFor: (NSDate *)date
>>> {
>>> 	NSDateFormatter *dateFormatter = [ [ NSDateFormatter alloc ] init];
>>> 	dateFormatter.dateFormat = @"EEE dd MMM yyyy HH:mm:ss ZZZ";
>>> 	NSString *un = [ dateFormatter stringFromDate: date ];
>>> 	NSLog(@"%s %@",__FUNCTION__, un);	//	Tue 01 Mar 2016 01:00:00 +0700
>>> 	return un;
>>> }
>>>
>>> prints “Tue 01 Mar 2016 01:00:00 +0700”
>>>
>>> What am I doing wrong?
>>>
>>> Gerriet.
>>>
>>> Mac OS X 10.10.5
>>>
>>>
>>>
>>> _______________________________________________
>>>
>>> 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
>


_______________________________________________

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: 
 >Why is the first of March a Tuesday (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Why is the first of March a Tuesday (From: Clark Cox <email@hidden>)
 >Re: Why is the first of March a Tuesday (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: 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: Why is the first of March a Tuesday
  • Index(es):
    • Date
    • Thread