<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/DateComponentsFormatter/calendar",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDateComponentsFormatter(py)calendar"
  },
  "title" : "calendar"
}
-->

# calendar

The default calendar to use when formatting date components.

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

## Discussion

The formatter uses the calendar in this property to format values that do not have an inherent calendar of their own. For example, the formatter uses this calendar when formatting an [`TimeInterval`](/documentation/Foundation/TimeInterval) value.

The default value of this property is the calendar returned by the [`autoupdatingCurrent`](/documentation/Foundation/NSCalendar/autoupdatingCurrent) method of [`NSCalendar`](/documentation/Foundation/NSCalendar). Setting this property to `nil` causes the formatter to use the Gregorian calendar with the `en_US_POSIX` locale.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)