<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/ISO8601DateFormatter",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSISO8601DateFormatter"
  },
  "title" : "ISO8601DateFormatter"
}
-->

# ISO8601DateFormatter

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

```
class ISO8601DateFormatter
```

## Overview

The [`ISO8601DateFormatter`](/documentation/Foundation/ISO8601DateFormatter) class generates and parses string representations of dates following the [ISO 8601](http://www.iso.org/iso/home/standards/iso8601) 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 ``doc://com.apple.foundation/documentation/Foundation/Date/ISO8601FormatStyle`` rather than ``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter``. The ``doc://com.apple.foundation/documentation/Foundation/FormatStyle`` API offers a declarative idiom for customizing the formatting of various types. Also, Foundation caches identical ``doc://com.apple.foundation/documentation/Foundation/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`](/documentation/Foundation/ISO8601DateFormatter/formatOptions)

Options for generating and parsing ISO 8601 date representations. See [`ISO8601DateFormatter.Options`](/documentation/Foundation/ISO8601DateFormatter/Options) for possible values.

[`timeZone`](/documentation/Foundation/ISO8601DateFormatter/timeZone)

The time zone used to create and parse date representations. When unspecified, GMT is used.

### Creating ISO 8601 Date Formatters

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

Initializes an ISO 8601 date formatter with default format, time zone, and options.

### Converting ISO 8601 Dates

[`string(from:)`](/documentation/Foundation/ISO8601DateFormatter/string(from:))

Creates and returns an ISO 8601 formatted string representation of the specified date.

[`date(from:)`](/documentation/Foundation/ISO8601DateFormatter/date(from:))

Creates and returns a date object from the specified ISO 8601 formatted string representation.

[`string(from:timeZone:formatOptions:)`](/documentation/Foundation/ISO8601DateFormatter/string(from:timeZone:formatOptions:))

Creates a representation of the specified date with a given time zone and format options.

### Constants

[`ISO8601DateFormatter.Options`](/documentation/Foundation/ISO8601DateFormatter/Options)

Options used to generate and parse ISO 8601 date representations.



---

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)