<!--
{
  "availability" : [
    "watchOS: 2.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "ClockKit",
  "identifier" : "/documentation/ClockKit/CLKDateTextProvider",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "ClockKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CLKDateTextProvider"
  },
  "title" : "CLKDateTextProvider"
}
-->

# CLKDateTextProvider

A formatted string that conveys a date without any time information.

```
class CLKDateTextProvider
```

## Overview

Use a date provider for strings that contain day, month, and year information. The text provider formats the date information consistently and in a way that makes the best use of the available space. It also takes into account the user’s region and locale settings.

When creating the formatted string, the date text provider creates the longest string that fits in the given space. It includes as many of the requested date elements as it can, but may truncate elements or use abbreviations as needed.

### Date Format Options

When creating a `CLKDateTextProvider` object, you must specify which calendar units you want included in the resulting date. Only the following calendar units are supported:

- <doc://com.apple.documentation/documentation/Foundation/NSCalendar/Unit/NSDayCalendarUnit>
- <doc://com.apple.documentation/documentation/Foundation/NSCalendar/Unit/NSMonthCalendarUnit>
- <doc://com.apple.documentation/documentation/Foundation/NSCalendar/Unit/NSWeekdayCalendarUnit>
- <doc://com.apple.documentation/documentation/Foundation/NSCalendar/Unit/NSYearCalendarUnit>

All other calendar units are ignored.

When formatting the date, the date text provider drops units starting at the end of the preceding list and working up. In other words, it drops the year first, followed by the weekday information, followed by the month. For example, a text provider configured to display all units for the date December 28, 2014 in the English-US locale would remove elements as follows until it encountered a string that fit the available space:

- `Saturday, December 28, 2015`
- `Saturday, December 28`
- `Saturday, Dec 28`
- `Sat, Dec 28`
- `Dec 28`
- `28`

## Topics

### Creating a Text Provider

[`init(date:units:)`](/documentation/ClockKit/CLKDateTextProvider/init(date:units:))

Creates and returns a text provider with the specified date and the default time zone.

[`initWithDate:units:`](/documentation/ClockKit/CLKDateTextProvider/initWithDate:units:)

Creates and returns a text provider with the specified date and the default time zone.

[`init(date:units:timeZone:)`](/documentation/ClockKit/CLKDateTextProvider/init(date:units:timeZone:))

Creates and returns a text provider with the specified date and time zone.

[`initWithDate:units:timeZone:`](/documentation/ClockKit/CLKDateTextProvider/initWithDate:units:timeZone:)

Creates and returns a text provider with the specified date and time zone.

### Getting the Date Information

[`date`](/documentation/ClockKit/CLKDateTextProvider/date)

The date to display.

[`timeZone`](/documentation/ClockKit/CLKDateTextProvider/timeZone)

The time zone used in the formatted string.

[`calendarUnits`](/documentation/ClockKit/CLKDateTextProvider/calendarUnits)

The calendar units to include in the formatted string.

[`uppercase`](/documentation/ClockKit/CLKDateTextProvider/uppercase)

A Boolean value that determines whether the date string displays in uppercase.



---

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)