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

# date(from:)

Creates and returns a date object from the specified ISO 8601 formatted string representation.

## Declaration

```swift
func date(from string: String) -> Date?
```

## Parameters

- `string`: The ISO 8601 formatted string representation of a date.

## Return Value

Return Value A date object, or nil if no valid date was found.

## See Also

### Converting ISO 8601 Dates

- [string(from:)](foundation/iso8601dateformatter/string(from:).md)
- [string(from:timeZone:formatOptions:)](foundation/iso8601dateformatter/string(from:timezone:formatoptions:).md)
