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

# dateTime

A default format style for formatting dates.

```
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); in other words, when the value type is [`Date`](/documentation/Foundation/Date). Typically, you use this with 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"]
for localeID in localeArray {
    print(meetingDate.formatted(.dateTime
                                .day(.twoDigits)
                                .month(.wide)
                                .weekday(.short)
                                .hour(.conversationalTwoDigits(amPM: .wide))
                                .locale(Locale(identifier: localeID))))
}

// Tu, October 27, 5 PM
// ti 27 oktober 17
// Tu 27 October, 17
// อ. 27 ตุลาคม 17
// ma 27 octobre à 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()
meetingDate.formatted(.dateTime)) // 10/28/2020, 12:13 AM
```

---

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)