• 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: NSDatePicker behaviour is odd when typing date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDatePicker behaviour is odd when typing date


  • Subject: Re: NSDatePicker behaviour is odd when typing date
  • From: Nick Zitzmann <email@hidden>
  • Date: Sun, 18 Mar 2007 12:19:13 -0600


On Mar 18, 2007, at 7:05 AM, Graham Perks wrote:

Simply create a window in IB and drag on an NSDatePicker. Now test the window. Set the date to 1/1/1900 12:00AM. Select the year and type 1500. Woah! The date changed to 1/24!!

In 1500 the Gregorian calendar did not exist, and Europe was on the flawed Julian calendar instead. The Julian calendar assumes that Earth circles around the sun in 365.25 days, when it's actually a little bit less than that, so the calendar came out of sync with the seasons a long time ago. The Gregorian calendar fixes that problem by subtracting a few leap days.


NSDatePicker (and every other class that uses NSCalendar) falls back on the Julian calendar for dates prior to October 4, 1582, which is when several predominantly Catholic countries in Europe switched to the Gregorian calendar. There is no way to make it always use the Gregorian calendar.

Actually it might be a challenge even setting the date to 1/1/1900. In the NSDatePicker inspector you get the same results. Type 1900 in the year field and it becomes 1901! Arrow down to get 1900. Change the hour forward from 12AM to 1AM. The date goes back to 12/31/1899!! What is going on?

This works correctly for me when I try it.

Nick Zitzmann
<http://www.chronosnet.com/>




_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: NSDatePicker behaviour is odd when typing date
      • From: Michael Hall <email@hidden>
    • Re: NSDatePicker behaviour is odd when typing date
      • From: Graham Perks <email@hidden>
References: 
 >NSDatePicker behaviour is odd when typing date (From: Graham Perks <email@hidden>)

  • Prev by Date: Re: Event handling and tracking rect question
  • Next by Date: Re: NSDatePicker behaviour is odd when typing date
  • Previous by thread: NSDatePicker behaviour is odd when typing date
  • Next by thread: Re: NSDatePicker behaviour is odd when typing date
  • Index(es):
    • Date
    • Thread