---
title: "string(from:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/dateintervalformatter/string(from:)"
---

# string(from:)

Returns a formatted string for the given date interval.

## Declaration

```swift
func string(from dateInterval: DateInterval) -> String?
```
