---
title: CFDateFormatter
framework: corefoundation
role: symbol
role_heading: Class
path: corefoundation/cfdateformatter
---

# CFDateFormatter

## Declaration

```swift
class CFDateFormatter
```

## Overview

Overview CFDateFormatter objects format the textual representations of CFDate and CFAbsoluteTime objects, and convert textual representations of dates and times into CFDate and CFAbsoluteTime objects. You can express the representation of dates and times very flexibly, for example “Thu 22 Dec 1994” is just as acceptable as “12/22/94.” You specify how strings are formatted and parsed by setting a format string and other properties of a CFDateFomatter object. The format of the format string itself is defined by Unicode Technical Standard #35; the version of the standard used varies with release of the operating system, and is described in Introduction to Data Formatting Programming Guide For Cocoa. note: CFDateFormatter is not thread safe, so you must not mutate a given date formatter simultaneously from multiple threads.

## Topics

### Creating a Date Formatter

- [CFDateFormatterCreate(_:_:_:_:)](corefoundation/cfdateformattercreate(_:_:_:_:).md)

### Configuring a Date Formatter

- [CFDateFormatterSetFormat(_:_:)](corefoundation/cfdateformattersetformat(_:_:).md)
- [CFDateFormatterSetProperty(_:_:_:)](corefoundation/cfdateformattersetproperty(_:_:_:).md)

### Parsing Strings

- [CFDateFormatterCreateDateFromString(_:_:_:_:)](corefoundation/cfdateformattercreatedatefromstring(_:_:_:_:).md)
- [CFDateFormatterGetAbsoluteTimeFromString(_:_:_:_:)](corefoundation/cfdateformattergetabsolutetimefromstring(_:_:_:_:).md)

### Creating Strings From Data

- [CFDateFormatterCreateStringWithAbsoluteTime(_:_:_:)](corefoundation/cfdateformattercreatestringwithabsolutetime(_:_:_:).md)
- [CFDateFormatterCreateStringWithDate(_:_:_:)](corefoundation/cfdateformattercreatestringwithdate(_:_:_:).md)
- [CFDateFormatterCreateDateFormatFromTemplate(_:_:_:_:)](corefoundation/cfdateformattercreatedateformatfromtemplate(_:_:_:_:).md)

### Getting Information About a Date Formatter

- [CFDateFormatterCopyProperty(_:_:)](corefoundation/cfdateformattercopyproperty(_:_:).md)
- [CFDateFormatterGetDateStyle(_:)](corefoundation/cfdateformattergetdatestyle(_:).md)
- [CFDateFormatterGetFormat(_:)](corefoundation/cfdateformattergetformat(_:).md)
- [CFDateFormatterGetLocale(_:)](corefoundation/cfdateformattergetlocale(_:).md)
- [CFDateFormatterGetTimeStyle(_:)](corefoundation/cfdateformattergettimestyle(_:).md)

### Getting the CFDateFormatter Type ID

- [CFDateFormatterGetTypeID()](corefoundation/cfdateformattergettypeid().md)

### Data Types

- [CFDateFormatterStyle](corefoundation/cfdateformatterstyle.md)

### Constants

- [Date Formatter Styles](corefoundation/date_formatter_styles.md)
- [Date Formatter Property Keys](corefoundation/date-formatter-property-keys.md)
- [Calendar Names](corefoundation/calendar-names.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)

## See Also

### Related Documentation

- [Data Formatting Guide for Core Foundation](apple-archive/documentation/CoreFoundation/Conceptual/CFDataFormatting/Articles/CFDataFormatting.html.md)

### Opaque Types

- [CFAllocator](corefoundation/cfallocator.md)
- [CFArray](corefoundation/cfarray.md)
- [CFAttributedString](corefoundation/cfattributedstring.md)
- [CFBag](corefoundation/cfbag.md)
- [CFBinaryHeap](corefoundation/cfbinaryheap.md)
- [CFBitVector](corefoundation/cfbitvector.md)
- [CFBoolean](corefoundation/cfboolean.md)
- [CFBundle](corefoundation/cfbundle.md)
- [CFCalendar](corefoundation/cfcalendar.md)
- [CFCharacterSet](corefoundation/cfcharacterset.md)
- [CFData](corefoundation/cfdata.md)
- [CFDate](corefoundation/cfdate.md)
- [CFDictionary](corefoundation/cfdictionary.md)
- [CFError](corefoundation/cferror.md)
- [CFFileDescriptor](corefoundation/cffiledescriptor.md)
