---
title: era
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsdatecomponents/era
---

# era

The number of eras.

## Declaration

```swift
var era: Int { get set }
```

## Discussion

Discussion This value is interpreted in the context of the calendar with which it is used—see Calendars, Date Components, and Calendar Units in Date and Time Programming Guide.

## See Also

### Accessing Years and Months

- [year](foundation/nsdatecomponents/year.md)
- [yearForWeekOfYear](foundation/nsdatecomponents/yearforweekofyear.md)
- [quarter](foundation/nsdatecomponents/quarter.md)
- [month](foundation/nsdatecomponents/month.md)
- [isLeapMonth](foundation/nsdatecomponents/isleapmonth.md)
