<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Date/ISO8601Format(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation4DateV13ISO8601FormatySSAC0cD5StyleVF"
  },
  "title" : "ISO8601Format(_:)"
}
-->

# ISO8601Format(_:)

Generates a locale-aware string representation of a date using the ISO 8601 date format.

```
func ISO8601Format(_ style: Date.ISO8601FormatStyle = .init()) -> String
```

## Parameters

`style`

A customized [`Date.ISO8601FormatStyle`](/documentation/Foundation/Date/ISO8601FormatStyle) to apply. By default, the method applies an unmodified ISO 8601 format style.

## Return Value

A string, formatted according to the specified style.

## Discussion

Calling this method is equivalent to passing a [`Date.ISO8601FormatStyle`](/documentation/Foundation/Date/ISO8601FormatStyle) to a date’s [`formatted()`](/documentation/Foundation/Date/formatted()) method.

---

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)