• 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
Getting an era's beginning date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting an era's beginning date


  • Subject: Getting an era's beginning date
  • From: Nick Zitzmann <email@hidden>
  • Date: Mon, 28 Jan 2008 16:49:05 -0700

What's the best way of getting the start date for a given era in an NSCalendar?

For days, weeks, etc. this is trivial, since they have a universal start time. But an era can begin and end at any point in time. These points in time are trivial to figure out on the Gregorian calendar (the AD era began on January 1, 1), but the Japanese calendar is a totally different story (the Heisei era began on January 7, 1989 for example).

I've tried to solve this by polling NSCalendar for era changes, by getting the date for the first day in the era (which may not actually be in the era) and stepping through days until the era of the day matches the desired era, but this takes way too long to calculate for all eras on the Japanese calendar, so I'm hoping there's a better way.

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

_______________________________________________

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


  • Follow-Ups:
    • Re: Getting an era's beginning date
      • From: 慧 松本 <email@hidden>
  • Prev by Date: Re: Drag and Drop Focus problem....
  • Next by Date: Re: Can't get a Parent-Child CoreData relationship working
  • Previous by thread: Re: Drag and Drop Focus problem....
  • Next by thread: Re: Getting an era's beginning date
  • Index(es):
    • Date
    • Thread