<!--
{
  "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/FormatStyle/quarter(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation4DateV11FormatStyleV7quarteryA2E6SymbolV7QuarterVF"
  },
  "title" : "quarter(_:)"
}
-->

# quarter(_:)

Modifies the date format style to use the specified quarter format style.

```
func quarter(_ format: Date.FormatStyle.Symbol.Quarter = .abbreviated) -> Date.FormatStyle
```

## Parameters

`format`

The quarter format style applied to the date format style.

## Return Value

A date format style modified to include the specified quarter style.

## Discussion

Possible values of [`Date.FormatStyle.Symbol.Quarter`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter) include [`abbreviated`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/abbreviated), [`narrow`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/narrow), [`oneDigit`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/oneDigit), [`twoDigits`](/documentation/Foundation/Date/FormatStyle/Symbol/Month/twoDigits), and [`wide`](/documentation/Foundation/Date/FormatStyle/Symbol/Month/wide).

This example shows a variety of [`Date.FormatStyle.Symbol.Quarter`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter) format styles applied to a date:

```swift
let meetingDate = Date() // Oct 7, 2020 at 3:00 PM
meetingDate.formatted(Date.FormatStyle().quarter(.abbreviated)) // Q4
meetingDate.formatted(Date.FormatStyle().quarter(.narrow)) // 4th quarter
meetingDate.formatted(Date.FormatStyle().quarter(.oneDigit)) // 4
meetingDate.formatted(Date.FormatStyle().quarter(.twoDigits)) // 04
meetingDate.formatted(Date.FormatStyle().quarter(.wide)) // 4th quarter
meetingDate.formatted(Date.FormatStyle().quarter()) // Q4
```

If you don’t provide a format, the [`abbreviated`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/abbreviated) static variable is the default format.

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)