6

I was playing around with NSCalendar and NSDateComponents today and I saw constants like NSDayCalendarUnit and NSEraCalendarUnit. NSDayCalendarUnit returns 4 if today is the 4th of December for instance. NSEraCalendarUnit returns the era which is apparently 1 at the time of posting. Anyone care to explain what an era is?

hollow7
  • 1,506
  • 1
  • 12
  • 20

1 Answers1

8

@Eimantas has it correct. It's AD/BC (or BCE and C.E. for non-Religious folks).

There's a bit more information about it in Apple's Date and Time Programming Guide (linked there). Look under the "Special Considerations for Historical Dates" section.

And the Date & Time Programming Guide's Historical Dates page has even more information, including on working with eras with backward time flow (i.e. the day which follows December 31, 7 BC is January 1, 6 BC).

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • 7
    +1 this is important because (for example) the Japanese calendar uses the Era to denote the reign of a single emperor. So while the Gregorian calendar only had had 2 eras do far, the Japanese calendar has had dozens. – Dave DeLong Nov 26 '11 at 15:51