Contents

Date

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

Declaration

struct Date

Mentioned in

Overview

A Date value encapsulates a single point in time, independent of any particular calendrical system or time zone. Date values represent a time interval relative to an absolute reference date.

The Date structure provides methods for comparing dates, calculating the time interval between two dates, and creating a new date from a time interval relative to another date. Use date values in conjunction with DateFormatter instances to create localized representations of dates and times and with Calendar instances to perform calendar arithmetic.

Date bridges to the NSDate class. You can use these interchangeably in code that interacts with Objective-C APIs.

Topics

Creating a Date

Retrieving the Current Date

Getting Temporal Boundaries

Comparing Dates

Getting Time Intervals

Adding or Subtracting a Time Interval

Formatting a Date

Describing Dates

Working with notification messages

Using Reference Types

Structures

Initializers

Type Aliases

Type Properties

Default Implementations

See Also

Date Representations