---
title: CLKDateTextProvider
framework: clockkit
role: symbol
role_heading: Class
path: clockkit/clkdatetextprovider
---

# CLKDateTextProvider

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

## Declaration

```swift
class CLKDateTextProvider
```

## Mentioned in

Creating a timeline entry

## Overview

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: NSDayCalendarUnit NSMonthCalendarUnit NSWeekdayCalendarUnit 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:)](clockkit/clkdatetextprovider/init(date:units:).md)
- [init(date:units:timeZone:)](clockkit/clkdatetextprovider/init(date:units:timezone:).md)

### Getting the Date Information

- [date](clockkit/clkdatetextprovider/date.md)
- [timeZone](clockkit/clkdatetextprovider/timezone.md)
- [calendarUnits](clockkit/clkdatetextprovider/calendarunits.md)
- [uppercase](clockkit/clkdatetextprovider/uppercase.md)

## Relationships

### Inherits From

- [CLKTextProvider](clockkit/clktextprovider.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Text providers

- [CLKSimpleTextProvider](clockkit/clksimpletextprovider.md)
- [CLKRelativeDateTextProvider](clockkit/clkrelativedatetextprovider.md)
- [CLKTimeIntervalTextProvider](clockkit/clktimeintervaltextprovider.md)
- [CLKTimeTextProvider](clockkit/clktimetextprovider.md)
- [CLKTextProvider](clockkit/clktextprovider.md)
