Skip navigation.
 
mlGetting an era's beginning date
FROM : Nick Zitzmann
DATE : Tue Jan 29 00:49:05 2008

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/>

Related mailsAuthorDate
mlGetting an era's beginning date Nick Zitzmann Jan 29, 00:49
mlRe: Getting an era's beginning date ? ?? Jan 29, 01:39
mlRe: Getting an era's beginning date Clark Cox Jan 29, 01:45
ml[WORKAROUND] Re: Getting an era's beginning date Nick Zitzmann Jan 29, 02:54
mlRe: Getting an era's beginning date Christopher Nebel Jan 29, 05:11
mlRe: Getting an era's beginning date Nick Zitzmann Jan 29, 05:31
mlRe: Getting an era's beginning date ? ?? Jan 29, 06:01
mlRe: Getting an era's beginning date Christopher Nebel Jan 29, 22:17
mlRe: Getting an era's beginning date Chris Kane Feb 1, 19:41