---
title: year
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/datecomponents/year
---

# year

A year or count of years.

## Declaration

```swift
var year: Int? { get set }
```

## Discussion

Discussion note: This value is interpreted in the context of the calendar in which it is used.

## See Also

### Accessing Months and Years

- [era](foundation/datecomponents/era.md)
- [yearForWeekOfYear](foundation/datecomponents/yearforweekofyear.md)
- [quarter](foundation/datecomponents/quarter.md)
- [month](foundation/datecomponents/month.md)
- [isLeapMonth](foundation/datecomponents/isleapmonth.md)
