<!--
{
  "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/IntervalFormatStyle/DateStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation4DateV19IntervalFormatStyleV0bE0a"
  },
  "title" : "Date.IntervalFormatStyle.DateStyle"
}
-->

# Date.IntervalFormatStyle.DateStyle

The type that defines date interval styles that vary in length or in their included components.

```
typealias DateStyle = Date.FormatStyle.DateStyle
```

## Discussion

The exact format depends on the locale. Possible values of date interval style include: [`omitted`](/documentation/Foundation/Date/FormatStyle/DateStyle/omitted), [`numeric`](/documentation/Foundation/Date/FormatStyle/DateStyle/numeric), [`abbreviated`](/documentation/Foundation/Date/FormatStyle/DateStyle/abbreviated), [`long`](/documentation/Foundation/Date/FormatStyle/DateStyle/long), and [`complete`](/documentation/Foundation/Date/FormatStyle/DateStyle/complete).

The following code sample shows a variety of date interval style format results using the `en_US` locale.

```swift
if let today = Calendar.current.date(byAdding: .day, value: -120, to: Date()),
   let thirtyDaysBeforeToday = Calendar.current.date(byAdding: .day, value: -30, to: today) {
   // today: Apr 11, 2021 at 7:14 AM
   // thirtyDaysBeforeToday: Mar 12, 2021 at 7:14 AM

   // Create a Range<Date>.
   let last30days = thirtyDaysBeforeToday..<today
    
    last30days.formatted(date: .omitted, time: .standard)
// 3/12/2021, 7:11:16 AM – 4/11/2021, 7:11:16 AM

    last30days.formatted(date: .numeric, time: .omitted)
// 3/12/2021 – 4/11/2021

    last30days.formatted(date: .abbreviated, time: .omitted)
// Mar 12 – Apr 11, 2021

    last30days.formatted(date: .long, time: .omitted)
// March 12 – April 11, 2021"

    last30days.formatted(date: .complete, time: .omitted)
// Friday, March 12 – Sunday, April 11, 2021

    last30days.formatted()
// 3/12/21, 7:14 AM – 4/11/21, 7:14 AM
}
```

The default date style is `numeric`.

---

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)