---
title: formatted()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/date/formatted()
---

# formatted()

Generates a locale-aware string representation of a date using the default date format style.

## Declaration

```swift
func formatted() -> String
```

## Return Value

Return Value A string, formatted according to the default style.

## Discussion

Discussion Use the formatted() method to apply the default format style to a date, as in the following example: let birthday = Date() print(birthday.formatted()) // 6/4/2021, 2:24 PM The default date format style uses the numeric date style and the shortened time style. To customize the formatted measurement string, use either the formatted(_:) method and include a Measurement.FormatStyle or the formatted(date:time:) and include a date and time style. For more information about formatting dates, see Date.FormatStyle.

## See Also

### Formatting a Date

- [formatted(date:time:)](foundation/date/formatted(date:time:).md)
- [formatted(_:)](foundation/date/formatted(_:).md)
- [Date.FormatStyle](foundation/date/formatstyle.md)
- [Date.RelativeFormatStyle](foundation/date/relativeformatstyle.md)
- [Date.IntervalFormatStyle](foundation/date/intervalformatstyle.md)
- [ISO8601Format(_:)](foundation/date/iso8601format(_:).md)
- [Date.ISO8601FormatStyle](foundation/date/iso8601formatstyle.md)
