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

# calendar

The calendar used to interpret the other values in this structure.

## Declaration

```swift
var calendar: Calendar? { get set }
```

## Discussion

Discussion note: API which uses DateComponents may have different behavior if this value is nil. For example, assuming the current calendar or ignoring certain values.

## See Also

### Initializing Date Components

- [init(calendar:timeZone:era:year:month:day:hour:minute:second:nanosecond:weekday:weekdayOrdinal:quarter:weekOfMonth:weekOfYear:yearForWeekOfYear:)](foundation/datecomponents/init(calendar:timezone:era:year:month:day:hour:minute:second:nanosecond:weekday:weekdayordinal:quarter:weekofmonth:weekofyear:yearforweekofyear:).md)
- [timeZone](foundation/datecomponents/timezone.md)
