<!--
{
  "availability" : [
    "watchOS: 7.0.0 - 27.2.0"
  ],
  "documentType" : "symbol",
  "framework" : "ClockKit",
  "identifier" : "/documentation/ClockKit/CLKRelativeDateTextProvider/init(date:relativeTo:style:units:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "ClockKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CLKRelativeDateTextProvider(cm)textProviderWithDate:relativeToDate:style:units:"
  },
  "title" : "init(date:relativeTo:style:units:)"
}
-->

# init(date:relativeTo:style:units:)

Creates a text provider that shows the difference in time between the provided dates.

```
convenience init(date: Date, relativeTo relativeToDate: Date?, style: CLKRelativeDateStyle, units calendarUnits: NSCalendar.Unit)
```

## Parameters

`date`

The starting date, used to calculate the relative date string.

`relativeToDate`

The end date, used to calculate the relative date string.

`style`

The style to use when formatting the relative date value. For a list of possible values, see [`CLKRelativeDateStyle`](/documentation/ClockKit/CLKRelativeDateStyle).

`calendarUnits`

The units to include in the resulting date string. For a list of supported calendar units, see [`Date Format Options`](/documentation/ClockKit/CLKRelativeDateTextProvider#Date-Format-Options).

## Discussion

This initializer creates a text provider that produces a fixed, relative date. If you want a text provider that automatically updates as time passes, use [`init(date:style:units:)`](/documentation/ClockKit/CLKRelativeDateTextProvider/init(date:style:units:)) instead.

---

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)