• 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: NSCalendarDate returns wrong dayOfWeek
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCalendarDate returns wrong dayOfWeek


  • Subject: Re: NSCalendarDate returns wrong dayOfWeek
  • From: Dominic Feira <email@hidden>
  • Date: Thu, 7 Oct 2004 19:06:00 -0400

Ack! My mistake. My code is supposed to be returning one year later that it is and I was checking that date in iCal. Sorry for filling the list with garbage guys!

Dominic Feira / Code Monkey / Ambrosia Software, Inc.

On Oct 7, 2004, at 5:57 PM, Kevin Ballard wrote:

7/12/2005 is a Tuesday. dayOfWeek: returns 0-6 with 0 as Sunday. Thus, dayOfWeek: returning 2 is indeed correct as 2 means Tuesday.

I checked the day using the unix 'cal' utility.

On Oct 7, 2004, at 5:46 PM, Dominic Feira wrote:

Somehow I have managed to construct a NSCalendarDate that returns the incorrect dayOfWeek.
I am doing a lot of manipulating of the date by adding years, months, and days to it depending on various parameters. I don't understand how it is possible to end up with a date that is incorrect.

I have using dateByAddingYears:months:days:hours:minutes:seconds. There is a small note in the docs that state it is possible to land on the next day by accident because of daylight savings time, but it doesn't say that the date you get will be out of synch with reality and invalid.

I log the date and I get:
[result dayOfWeek]: 2 // SHOULD BE 3
2005-07-12 18:17:45 -0400

If you check in iCal, this is clearly incorrect.

Is there something about NSCalendarDate that I am misunderstanding?

--
Kevin Ballard
email@hidden
http://www.tildesoft.com
http://kevin.sb.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >NSCalendarDate returns wrong dayOfWeek (From: Dominic Feira <email@hidden>)
 >Re: NSCalendarDate returns wrong dayOfWeek (From: Kevin Ballard <email@hidden>)

  • Prev by Date: Re: small notes on enabling of menus in a modal window
  • Next by Date: Re: Using outlets from NSView subclass
  • Previous by thread: Re: NSCalendarDate returns wrong dayOfWeek
  • Next by thread: why every image has the same resolution?
  • Index(es):
    • Date
    • Thread