<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/DateComponents/ISO8601FormatStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation14DateComponentsV18ISO8601FormatStyleV"
  },
  "title" : "DateComponents.ISO8601FormatStyle"
}
-->

# DateComponents.ISO8601FormatStyle

Options for generating and parsing string representations of dates following the ISO 8601 standard.

```
struct ISO8601FormatStyle
```

## Topics

### Initializers

[`init(dateSeparator: Date.ISO8601FormatStyle.DateSeparator, dateTimeSeparator: Date.ISO8601FormatStyle.DateTimeSeparator, timeSeparator: Date.ISO8601FormatStyle.TimeSeparator, timeZoneSeparator: Date.ISO8601FormatStyle.TimeZoneSeparator, includingFractionalSeconds: Bool, timeZone: TimeZone)`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/init(dateSeparator:dateTimeSeparator:timeSeparator:timeZoneSeparator:includingFractionalSeconds:timeZone:))

### Instance Properties

[`var dateSeparator: Date.ISO8601FormatStyle.DateSeparator`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/dateSeparator)

[`var dateTimeSeparator: Date.ISO8601FormatStyle.DateTimeSeparator`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/dateTimeSeparator)

[`var includingFractionalSeconds: Bool`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/includingFractionalSeconds)

If set, fractional seconds will be present in formatted output. Fractional seconds may be present in parsing regardless of the setting of this property.

[`var timeSeparator: Date.ISO8601FormatStyle.TimeSeparator`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/timeSeparator)

[`var timeZone: TimeZone`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/timeZone)

The time zone to use to create and parse date representations.

[`var timeZoneSeparator: Date.ISO8601FormatStyle.TimeZoneSeparator`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/timeZoneSeparator)

### Instance Methods

[`func dateSeparator(Date.ISO8601FormatStyle.DateSeparator) -> DateComponents.ISO8601FormatStyle`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/dateSeparator(_:))

[`func dateTimeSeparator(Date.ISO8601FormatStyle.DateTimeSeparator) -> DateComponents.ISO8601FormatStyle`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/dateTimeSeparator(_:))

[`func day() -> DateComponents.ISO8601FormatStyle`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/day())

[`func month() -> DateComponents.ISO8601FormatStyle`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/month())

[`func time(includingFractionalSeconds: Bool) -> DateComponents.ISO8601FormatStyle`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/time(includingFractionalSeconds:))

[`func timeSeparator(Date.ISO8601FormatStyle.TimeSeparator) -> DateComponents.ISO8601FormatStyle`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/timeSeparator(_:))

[`func timeZone(separator: Date.ISO8601FormatStyle.TimeZoneSeparator) -> DateComponents.ISO8601FormatStyle`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/timeZone(separator:))

[`func timeZoneSeparator(Date.ISO8601FormatStyle.TimeZoneSeparator) -> DateComponents.ISO8601FormatStyle`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/timeZoneSeparator(_:))

[`func weekOfYear() -> DateComponents.ISO8601FormatStyle`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/weekOfYear())

[`func year() -> DateComponents.ISO8601FormatStyle`](/documentation/Foundation/DateComponents/ISO8601FormatStyle/year())

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Escapable`](/documentation/Swift/Escapable)

[`CustomConsumingRegexComponent`](/documentation/Swift/CustomConsumingRegexComponent)

[`Decodable`](/documentation/Swift/Decodable)

[`RegexComponent`](/documentation/Swift/RegexComponent)

[`Sendable`](/documentation/Swift/Sendable)

[`Encodable`](/documentation/Swift/Encodable)

[`Copyable`](/documentation/Swift/Copyable)

[`Equatable`](/documentation/Swift/Equatable)

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

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

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

---

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)