<!--
{
  "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/formatOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSISO8601DateFormatter(py)formatOptions"
  },
  "title" : "formatOptions"
}
-->

# formatOptions

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

```
var formatOptions: ISO8601DateFormatter.Options { get set }
```

## Discussion

The ISO 8601 specification allows for dates to be expressed in a variety of ways. You can configure the format used to parse and generate representations by specifying various combinations of format options.

|Format                                                    |Example                    |Options                                                                                                                                                                                                                                                                                                                                                                                                       |
|----------------------------------------------------------|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|Date with dash separators                                 |`2016-06-13`               |``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withFullDate``, ``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withDashSeparatorInDate``                                                                                                                                                                                               |
|[RFC 3339](https://www.ietf.org/rfc/rfc3339) Date and Time|`2016-06-13T16:00:00+00:00`|``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withInternetDateTime``                                                                                                                                                                                                                                                                                                     |
|Date and Time with space separator between date and time  |`20160613 160000`          |``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withFullDate``, ``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withFullTime``, ``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withSpaceBetweenDateAndTime``                                                                                        |
|Week of Year                                              |`2016-W24`                 |``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withYear``, ``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withWeekOfYear``, ``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withDashSeparatorInDate``                                                                                              |
|Week of Year with Ordinal Weekday                         |`2016-W24-1`               |``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withYear``, ``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withWeekOfYear``, ``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withDay``, ``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withDashSeparatorInDate``|
|Ordinal Day of Year                                       |`2016-165`                 |``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withYear``, ``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withDay``, ``doc://com.apple.foundation/documentation/Foundation/ISO8601DateFormatter/Options/withDashSeparatorInDate``                                                                                                     |

> Important:
> Resetting this property can incur a significant performance cost, as it may cause internal state to be regenerated.

---

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)