---
title: Date
framework: foundation
role: symbol
role_heading: Structure
path: foundation/date
---

# Date

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

## Declaration

```swift
struct Date
```

## Mentioned in

Encoding and Decoding Custom Types

## Overview

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

- [init()](foundation/date/init().md)
- [init(timeIntervalSinceNow:)](foundation/date/init(timeintervalsincenow:).md)
- [init(timeInterval:since:)](foundation/date/init(timeinterval:since:).md)
- [init(timeIntervalSinceReferenceDate:)](foundation/date/init(timeintervalsincereferencedate:).md)
- [init(timeIntervalSince1970:)](foundation/date/init(timeintervalsince1970:).md)

### Retrieving the Current Date

- [now](foundation/date/now.md)

### Getting Temporal Boundaries

- [distantFuture](foundation/date/distantfuture.md)
- [distantPast](foundation/date/distantpast.md)

### Comparing Dates

- [==(_:_:)](foundation/date/==(_:_:).md)
- [>(_:_:)](foundation/date/_(_:_:)-880ns.md)
- [<(_:_:)](foundation/date/_(_:_:)-42kro.md)
- [compare(_:)](foundation/date/compare(_:).md)
- [distance(to:)](foundation/date/distance(to:).md)

### Getting Time Intervals

- [timeIntervalSince(_:)](foundation/date/timeintervalsince(_:).md)
- [timeIntervalSinceNow](foundation/date/timeintervalsincenow.md)
- [timeIntervalSinceReferenceDate](foundation/date/timeintervalsincereferencedate-swift.property.md)
- [timeIntervalSince1970](foundation/date/timeintervalsince1970.md)
- [timeIntervalSinceReferenceDate](foundation/date/timeintervalsincereferencedate-swift.type.property.md)
- [timeIntervalBetween1970AndReferenceDate](foundation/date/timeintervalbetween1970andreferencedate.md)
- [Date.Stride](foundation/date/stride.md)

### Adding or Subtracting a Time Interval

- [addTimeInterval(_:)](foundation/date/addtimeinterval(_:).md)
- [addingTimeInterval(_:)](foundation/date/addingtimeinterval(_:).md)
- [advanced(by:)](foundation/date/advanced(by:).md)
- [+(_:_:)](foundation/date/+(_:_:).md)
- [+=(_:_:)](foundation/date/+=(_:_:).md)
- [-(_:_:)](foundation/date/-(_:_:).md)
- [-=(_:_:)](foundation/date/-=(_:_:).md)

### Formatting a Date

- [formatted()](foundation/date/formatted().md)
- [formatted(date:time:)](foundation/date/formatted(date:time:).md)
- [formatted(_:)](foundation/date/formatted(_:).md)
- [Date.FormatStyle](foundation/date/formatstyle.md)
- [Date.RelativeFormatStyle](foundation/date/relativeformatstyle.md)
- [Date.IntervalFormatStyle](foundation/date/intervalformatstyle.md)
- [ISO8601Format(_:)](foundation/date/iso8601format(_:).md)
- [Date.ISO8601FormatStyle](foundation/date/iso8601formatstyle.md)

### Describing Dates

- [description](foundation/date/description.md)
- [description(with:)](foundation/date/description(with:).md)
- [customPlaygroundQuickLook](foundation/date/customplaygroundquicklook.md)

### Working with notification messages

- [Date.SystemClockDidChangeMessage](foundation/date/systemclockdidchangemessage.md)

### Using Reference Types

- [NSDate](foundation/nsdate.md)

### Structures

- [Date.AnchoredRelativeFormatStyle](foundation/date/anchoredrelativeformatstyle.md)
- [Date.AttributedStyle](foundation/date/attributedstyle.md)
- [Date.ComponentsFormatStyle](foundation/date/componentsformatstyle.md)
- [Date.FormatString](foundation/date/formatstring.md)
- [Date.HTTPFormatStyle](foundation/date/httpformatstyle.md)
- [Date.ParseStrategy](foundation/date/parsestrategy.md)
- [Date.VerbatimFormatStyle](foundation/date/verbatimformatstyle.md)

### Initializers

- [init(_:strategy:)](foundation/date/init(_:strategy:)-2oqi.md)
- [init(_:strategy:)](foundation/date/init(_:strategy:)-6cq9s.md)

### Type Aliases

- [Date.Specification](foundation/date/specification.md)
- [Date.UnwrappedType](foundation/date/unwrappedtype.md)
- [Date.ValueType](foundation/date/valuetype.md)

### Type Properties

- [defaultResolverSpecification](foundation/date/defaultresolverspecification.md)

### Default Implementations

- [CustomStringConvertible Implementations](foundation/date/customstringconvertible-implementations.md)
- [Strideable Implementations](foundation/date/strideable-implementations.md)

## Relationships

### Conforms To

- [CKRecordValueProtocol](cloudkit/ckrecordvalueprotocol.md)
- [CVAttachmentValueRepresentable](corevideo/cvattachmentvaluerepresentable.md)
- [Comparable](swift/comparable.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomReflectable](swift/customreflectable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [IntentValueConvertible](appintents/intentvalueconvertible.md)
- [IntentValueExpressing](appintents/intentvalueexpressing.md)
- [Plottable](charts/plottable.md)
- [PrimitivePlottableProtocol](charts/primitiveplottableprotocol.md)
- [ReferenceConvertible](foundation/referenceconvertible.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [Strideable](swift/strideable.md)

## See Also

### Date Representations

- [DateInterval](foundation/dateinterval.md)
- [TimeInterval](foundation/timeinterval.md)
