Dates and Times

Compare dates and times, and perform calendar and time zone calculations.

Topics

Date Representations

NSDate

A representation of a specific point in time, independent of any calendar or time zone.

NSDateInterval

An object representing the span of time between a specific start date and end date.

NSTimeInterval

A number of seconds.

Calendrical Calculations

NSDateComponents

An object that specifies a date or time in terms of units (such as year, month, day, hour, and minute) to be evaluated in a calendar system and time zone.

NSCalendar

An object that defines the relationships between calendar units (such as eras, years, and weekdays) and absolute points in time, providing features for calculation and comparison of dates.

NSTimeZone

An object containing information about standard time conventions associated with a specific geopolitical region.

Date Formatting

NSDateFormatter

A formatter that converts between dates and their textual representations.

NSDateComponentsFormatter

A formatter that creates string representations of quantities of time.

NSDateIntervalFormatter

A formatter that creates string representations of time intervals.

NSISO8601DateFormatter

A formatter that converts between dates and their IOS 8601 string representations.

Internationalization

NSLocale

Information about linguistic, cultural, and technological conventions for use in formatting data for presentation.

Deprecated

NSCalendarDate

A specialized date object with embedded calendar information.

Deprecated

See Also

Fundamentals

Numbers, Data, and Basic Values

Work with primitive values and other fundamental types used throughout Cocoa.

Strings and Text

Create and process strings of Unicode characters, use regular expressions to find patterns, and perform natural language analysis of text.

Collections

Use arrays, dictionaries, sets, and specialized collections to store and iterate groups of objects or values.

Units and Measurement

Label numeric quantities with physical dimensions to allow locale-aware formatting and conversion between related units.

Data Formatting

Convert numbers, dates, measurements, and other values to and from locale-aware string representations.

Filters and Sorting

Use predicates, expressions, and sort descriptors to examine elements in collections and other services.