---
title: "format(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/date/attributedstyle/format(_:)"
---

# format(_:)

Creates a locale-aware attributed string representation from a date value.

## Declaration

```swift
func format(_ value: Date) -> AttributedString
```

## Parameters

- `value`: The date to format.

## Return Value

Return Value An attributed string representation of the date.

## Discussion

Discussion The Date.ISO8601FormatStyle format(_:) instance method generates an attributed string from the provided date. Once you create a style, you can use it to format dates multiple times. For an example of formatting multiple dates into plain strings, see format(_:).
