---
title: "format(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/duration/timeformatstyle/format(_:)"
---

# format(_:)

Creates a locale-aware string representation from a duration value.

## Declaration

```swift
func format(_ value: Duration) -> String
```

## Parameters

- `value`: The duration value to format.

## Return Value

Return Value A string representation of the duration, according to the style’s pattern and locale.

## Discussion

Discussion Use this method when you want to create a format style and repeatedly use it to format different durations. For one-off cases with default formatting, call the formatted(_:) method of Duration instead.
