<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Date/formatted()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation4DateV9formattedSSyF"
  },
  "title" : "formatted()"
}
-->

# formatted()

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

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

## Return Value

A string, formatted according to the default style.

## Discussion

Use the [`formatted()`](/documentation/Foundation/Date/formatted()) method to apply the default format style to a date, as in the following example:

```swift
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(_:)`](/documentation/Foundation/Date/formatted(_:)) method and include a `Measurement.FormatStyle` or the [`formatted(date:time:)`](/documentation/Foundation/Date/formatted(date:time:)) and include a date and time style.

For more information about formatting dates, see [`Date.FormatStyle`](/documentation/Foundation/Date/FormatStyle).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)