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/>
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 mails | Author | Date |
|---|---|---|
| Nick Zitzmann | Jan 29, 00:49 | |
| ? ?? | Jan 29, 01:39 | |
| Clark Cox | Jan 29, 01:45 | |
| Nick Zitzmann | Jan 29, 02:54 | |
| Christopher Nebel | Jan 29, 05:11 | |
| Nick Zitzmann | Jan 29, 05:31 | |
| ? ?? | Jan 29, 06:01 | |
| Christopher Nebel | Jan 29, 22:17 | |
| Chris Kane | Feb 1, 19:41 |






Cocoa mail archive

