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.


Creating a Date Formatter


Creates a new CFDateFormatter object, localized to the given locale, which will format dates to the given date and time styles.

Configuring a Date Formatter


Sets the format string of the given date formatter to the specified value.


Sets a date formatter property using a key-value pair.

Parsing Strings


Returns a date object representing a given string.


Returns an absolute time object representing a given string.

Creating Strings From Data


Returns a string representation of the given absolute time using the specified date formatter.


Returns a string representation of the given date using the specified date formatter.


Returns a localized date format string representing the given date format components arranged appropriately for the specified locale.

Getting Information About a Date Formatter


Returns a copy of a date formatter’s value for a given key.


Returns the date style used to create the given date formatter object.


Returns a format string for the given date formatter object.


Returns the locale object used to create the given date formatter object.


Returns the time style used to create the given date formatter object.

Getting the CFDateFormatter Type ID


Returns the type identifier for CFDateFormatter.

Data Types


Data type for predefined date and time format styles.


A reference to a CFDateFormatter object.


Date Formatter Styles

Predefined date and time format styles.

Date Formatter Property Keys

Keys used in key-value pairs to discover and specify the value of date formatter properties—used in conjunction with CFDateFormatterCopyProperty and CFDateFormatterSetProperty.

Calendar Names

Calendar names used by CFDateFormatter.

See Also

Opaque Types


The CFFileDescriptor provides an opaque type to monitor file descriptors for read and write activity via CFRunLoop.


CFStringTokenizer allows you to tokenize strings into words, sentences or paragraphs in a language-neutral way. It supports languages such as Japanese and Chinese that do not delimit words by spaces, as well as de-compounding German compounds. You can obtain Latin transcription for tokens. It also provides language identification API.