---
title: ISO8601DateFormatter
framework: foundation
role: symbol
role_heading: Class
path: foundation/iso8601dateformatter
---

# ISO8601DateFormatter

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

## Declaration

```swift
class ISO8601DateFormatter
```

## Overview

Overview The ISO8601DateFormatter class generates and parses string representations of dates following the ISO 8601 standard. Use this class to create ISO 8601 representations of dates and create dates from text strings in ISO 8601 format. tip: In Swift, you can use Date.ISO8601FormatStyle rather than ISO8601DateFormatter. The FormatStyle API offers a declarative idiom for customizing the formatting of various types. Also, Foundation caches identical FormatStyle instances, so you don’t need to pass them around your app, or risk wasting memory with duplicate formatters.

## Topics

### Configuring the Formatter

- [formatOptions](foundation/iso8601dateformatter/formatoptions.md)
- [timeZone](foundation/iso8601dateformatter/timezone.md)

### Creating ISO 8601 Date Formatters

- [init()](foundation/iso8601dateformatter/init().md)

### Converting ISO 8601 Dates

- [string(from:)](foundation/iso8601dateformatter/string(from:).md)
- [date(from:)](foundation/iso8601dateformatter/date(from:).md)
- [string(from:timeZone:formatOptions:)](foundation/iso8601dateformatter/string(from:timezone:formatoptions:).md)

### Constants

- [ISO8601DateFormatter.Options](foundation/iso8601dateformatter/options.md)

## Relationships

### Inherits From

- [Formatter](foundation/formatter.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Dates and times

- [DateFormatter](foundation/dateformatter.md)
- [DateComponentsFormatter](foundation/datecomponentsformatter.md)
- [RelativeDateTimeFormatter](foundation/relativedatetimeformatter.md)
- [DateIntervalFormatter](foundation/dateintervalformatter.md)
