<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Date",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation4DateV"
  },
  "title" : "Date"
}
-->

# Date

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

```
struct Date
```

## Overview

A [`Date`](/documentation/Foundation/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`](/documentation/Foundation/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`](/documentation/Foundation/DateFormatter) instances to create localized representations of dates and times and with [`Calendar`](/documentation/Foundation/Calendar) instances to perform calendar arithmetic.

[`Date`](/documentation/Foundation/Date) bridges to the [`NSDate`](/documentation/Foundation/NSDate) class. You can use these interchangeably in code that interacts with Objective-C APIs.

## Topics

### Creating a Date

[`init()`](/documentation/Foundation/Date/init())

Creates a date value initialized to the current date and time.

[`init(timeIntervalSinceNow:)`](/documentation/Foundation/Date/init(timeIntervalSinceNow:))

Creates a date value initialized relative to the current date and time by a given number of seconds.

[`init(timeInterval:since:)`](/documentation/Foundation/Date/init(timeInterval:since:))

Creates a date value initialized relative to another given date by a given number of seconds.

[`init(timeIntervalSinceReferenceDate:)`](/documentation/Foundation/Date/init(timeIntervalSinceReferenceDate:))

Creates a date value initialized relative to 00:00:00 UTC on 1 January 2001 by a given number of seconds.

[`init(timeIntervalSince1970:)`](/documentation/Foundation/Date/init(timeIntervalSince1970:))

Creates a date value initialized relative to 00:00:00 UTC on 1 January 1970 by a given number of seconds.

### Retrieving the Current Date

[`now`](/documentation/Foundation/Date/now)

Returns a date instance that represents the current date and time, at the moment of access.

### Getting Temporal Boundaries

[`distantFuture`](/documentation/Foundation/Date/distantFuture)

A date value representing a date in the distant future.

[`distantPast`](/documentation/Foundation/Date/distantPast)

A date value representing a date in the distant past.

### Comparing Dates

[`==(_:_:)`](/documentation/Foundation/Date/==(_:_:))

Returns true if the two `Date` values represent the same point in time.

[`>(_:_:)`](/documentation/Foundation/Date/_(_:_:)-880ns)

Returns true if the left hand `Date` is later in time than the right hand `Date`.

[`<(_:_:)`](/documentation/Foundation/Date/_(_:_:)-42kro)

Returns true if the left hand `Date` is earlier in time than the right hand `Date`.

[`compare(_:)`](/documentation/Foundation/Date/compare(_:))

Compares another date to this one.

[`distance(to:)`](/documentation/Foundation/Date/distance(to:))

Returns the distance from this date to another date, specified as a time interval.

### Getting Time Intervals

[`timeIntervalSince(_:)`](/documentation/Foundation/Date/timeIntervalSince(_:))

Returns the interval between this date and another given date.

[`timeIntervalSinceNow`](/documentation/Foundation/Date/timeIntervalSinceNow)

The time interval between the date value and the current date and time.

[`timeIntervalSinceReferenceDate`](/documentation/Foundation/Date/timeIntervalSinceReferenceDate-swift.property)

The interval between the date value and 00:00:00 UTC on 1 January 2001.

[`timeIntervalSince1970`](/documentation/Foundation/Date/timeIntervalSince1970)

The interval between the date value and 00:00:00 UTC on 1 January 1970.

[`timeIntervalSinceReferenceDate`](/documentation/Foundation/Date/timeIntervalSinceReferenceDate-swift.type.property)

The interval between 00:00:00 UTC on 1 January 2001 and the current date and time.

[`timeIntervalBetween1970AndReferenceDate`](/documentation/Foundation/Date/timeIntervalBetween1970AndReferenceDate)

The number of seconds from 1 January 1970 to the reference date, 1 January 2001.

[`Date.Stride`](/documentation/Foundation/Date/Stride)

A type alias to define the stride of a date.

### Adding or Subtracting a Time Interval

[`addTimeInterval(_:)`](/documentation/Foundation/Date/addTimeInterval(_:))

Adds a time interval to this date.

[`addingTimeInterval(_:)`](/documentation/Foundation/Date/addingTimeInterval(_:))

Creates a new date value by adding a time interval to this date.

[`advanced(by:)`](/documentation/Foundation/Date/advanced(by:))

Returns a date offset the specified time interval from this date.

[`+(_:_:)`](/documentation/Foundation/Date/+(_:_:))

Returns a date with a specified amount of time added to it.

[`+=(_:_:)`](/documentation/Foundation/Date/+=(_:_:))

Adds a time interval to a date.

[`-(_:_:)`](/documentation/Foundation/Date/-(_:_:))

Returns a `Date` with a specified amount of time subtracted from it.

[`-=(_:_:)`](/documentation/Foundation/Date/-=(_:_:))

Subtract a `TimeInterval` from a `Date`.

### Formatting a Date

[`formatted()`](/documentation/Foundation/Date/formatted())

Generates a locale-aware string representation of a date using the default date format style.

[`formatted(date:time:)`](/documentation/Foundation/Date/formatted(date:time:))

Generates a locale-aware string representation of a date using specified date and time format styles.

[`formatted(_:)`](/documentation/Foundation/Date/formatted(_:))

Generates a locale-aware string representation of a date using the specified date format style.

[`Date.FormatStyle`](/documentation/Foundation/Date/FormatStyle)

A structure that creates a locale-appropriate string representation of a date instance and converts strings of dates and times into date instances.

[`Date.RelativeFormatStyle`](/documentation/Foundation/Date/RelativeFormatStyle)

A format style that forms locale-aware string representations of a relative date or time.

[`Date.IntervalFormatStyle`](/documentation/Foundation/Date/IntervalFormatStyle)

A format style that creates string representations of date intervals.

[`ISO8601Format(_:)`](/documentation/Foundation/Date/ISO8601Format(_:))

Generates a locale-aware string representation of a date using the ISO 8601 date format.

[`Date.ISO8601FormatStyle`](/documentation/Foundation/Date/ISO8601FormatStyle)

A type that converts between dates and their ISO-8601 string representations.

### Creating Date Ranges

### Encoding Dates

### Describing Dates

[`description`](/documentation/Foundation/Date/description)

The representation is useful for debugging only.
There are a number of options to acquire a formatted string for a date including: date formatters
(see [NSDateFormatter](//apple_ref/occ/cl/NSDateFormatter) and
[Data Formatting Guide](//apple_ref/doc/uid/10000029i)), and the `Date`
function `description(locale:)`.

[`description(with:)`](/documentation/Foundation/Date/description(with:))

Returns a string representation of the receiver using the given
locale.

[`customPlaygroundQuickLook`](/documentation/Foundation/Date/customPlaygroundQuickLook)

A custom playground Quick Look for the date.

### Working with notification messages

[`Date.SystemClockDidChangeMessage`](/documentation/Foundation/Date/SystemClockDidChangeMessage)

A message the system sends when the system clock changes.

### Using Reference Types

[`NSDate`](/documentation/Foundation/NSDate)

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



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)