---
title: referenceDate
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/datecomponentsformatter/referencedate
---

# referenceDate

Where units have variable length (number of days in a month, number of hours in a day, etc.), NSDateComponentsFormatter will calculate as though counting from the date specified by the referenceDate in the appropriate calendar. Defaults to [NSDate dateWithTimeIntervalSinceReferenceDate:0] at the time of the -stringForObjectValue: call if not set. Set to nil to get the default behavior.

## Declaration

```swift
var referenceDate: Date? { get set }
```
