Re: Bug in NSCalendarDate?
Re: Bug in NSCalendarDate?
- Subject: Re: Bug in NSCalendarDate?
- From: Nicko van Someren <email@hidden>
- Date: Mon, 3 May 2004 16:47:34 +0100
On 3 May 2004, at 16:33, Pat Homelvig wrote:
Using the method:
[NSCalendarDate dateWithYear:2004 month:0 day:ii hour:0 minute:0
second:0 timeZone:[NSTimeZone localTimeZone]]
returns date=2004-05-06 00:00:00 -0600 when ii = 127
returns date=2003-08-25 00:00:00 -0600 when ii = 128
...
Am I missing something?
Yup, you're missing the documentation, which clearly states:
Creates and returns a calendar date initialized with the specified
values for year, month, day, hour, minute, second, and time zone,
aTimeZone. The year value must include the century (for example, 1999
instead of 99). The other values are the standard ones: 1 through 12
for months, 1 through 31 for days, 0 through 23 for hours, and 0
through 59 for both minutes and seconds.
Your day numbers are not in the range 1 through 31, so the behaviour is
undefined and thus this is not a bug.
Nicko
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.