<!--
{
  "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/Symbol/Quarter",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation4DateV11FormatStyleV6SymbolV7QuarterV"
  },
  "title" : "Date.FormatStyle.Symbol.Quarter"
}
-->

# Date.FormatStyle.Symbol.Quarter

A type that specifies the format for the quarter in a date format style.

```
struct Quarter
```

## Overview

The type [`Date.FormatStyle.Symbol.Quarter`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter) includes static factory variables that create custom [`Date.FormatStyle.Symbol.Quarter`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter) objects:

|Factory variable                                                                                   |Description                                                                     |
|---------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
|``doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/abbreviated``|Abbreviated quarter name. For example, `Q2`.                                    |
|``doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/narrow``     |Minimum number of digits that represents the  numeric quarter. For example, `2`.|
|``doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/oneDigit``   |One-digit numeric quarter. For example, `1`, `4`.                               |
|``doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/twoDigits``  |Two-digit numeric quarter, zero-padded if necessary. For example, `01`, `04`.   |
|``doc://com.apple.foundation/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/wide``       |Wide quarter name. For example, `2nd quarter`.                                  |

To customize the month format in a string representation of a `Date`, use [`quarter(_:)`](/documentation/Foundation/Date/FormatStyle/quarter(_:)). The following 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 no format is specified as a parameter, the [`abbreviated`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/abbreviated) static variable is the default format.

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

## Topics

### Modifying a Quarter

[`static var abbreviated: Date.FormatStyle.Symbol.Quarter`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/abbreviated)

The abbreviated representation of a quarter.

[`static var narrow: Date.FormatStyle.Symbol.Quarter`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/narrow)

The shortest representation of a quarter.

[`static var oneDigit: Date.FormatStyle.Symbol.Quarter`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/oneDigit)

The one-digit representation of a quarter.

[`static var twoDigits: Date.FormatStyle.Symbol.Quarter`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/twoDigits)

The two-digit representation of a quarter.

[`static var wide: Date.FormatStyle.Symbol.Quarter`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/wide)

The full representation of a quarter.

### Comparing Quarters

[`static func == (Date, Date) -> Bool`](/documentation/Foundation/Date/==(_:_:))

Returns true if the two `Date` values represent the same point in time.

### Type Properties

[`static let omitted: Date.FormatStyle.Symbol.Quarter`](/documentation/Foundation/Date/FormatStyle/Symbol/Quarter/omitted)

The option for not including the symbol in the formatted output.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

---

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)