<!--
{
  "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/ParseableFormatStyle/dateTime",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation20ParseableFormatStylePA2A4DateV0cD0VRszrlE8dateTimeAGvpZ"
  },
  "title" : "dateTime"
}
-->

# dateTime

A style for formatting a date and time.

```
static var dateTime: Date.FormatStyle { get }
```

## Discussion

Use this type property when the call point allows the use of [`Date.FormatStyle`](/documentation/Foundation/Date/FormatStyle).
You typically do this when calling the [`formatted(_:)`](/documentation/Foundation/Date/formatted(_:)) method of [`Date`](/documentation/Foundation/Date).

Customize the date format style using modifier syntax to apply specific date and time
formats. For example:

```swift
let meetingDate = Date()
let localeArray = ["en_US", "sv_SE", "en_GB", "th_TH", "fr_BE"]
let formattedDates = localeArray.map { localeID in
    meetingDate.formatted(.dateTime
                          .day(.twoDigits)
                          .month(.wide)
                          .weekday(.short)
                          .hour(.conversationalTwoDigits(amPM: .wide))
                          .locale(Locale(identifier: localeID)))
        } // ["Mo, July 31 at 05 PM", "må 31 juli 17", "Mo, 31 July at 17", "จ. 31 กรกฎาคม เวลา 17", "lu 31 juillet à 17 h"]
```

The default format styles provided are [`numeric`](/documentation/Foundation/Date/FormatStyle/DateStyle/numeric) date format
and [`shortened`](/documentation/Foundation/Date/FormatStyle/TimeStyle/shortened) time format. For example:

```swift
let meetingDate = Date()
let formatted = meetingDate.formatted(.dateTime) // "7/31/2023, 5:15 PM"
```

---

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)