---
title: "quarter(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/date/formatstyle/quarter(_:)"
---

# quarter(_:)

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

## Declaration

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

## Parameters

- `format`: The quarter format style applied to the date format style.

## Return Value

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

## Discussion

Discussion Possible values of Date.FormatStyle.Symbol.Quarter include abbreviated, narrow, oneDigit, twoDigits, and wide. This example shows a variety of Date.FormatStyle.Symbol.Quarter format styles applied to a date: 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 static variable is the default format. For more information about formatting dates, see Date.FormatStyle.

## See Also

### Specifying the Date Format

- [day(_:)](foundation/date/formatstyle/day(_:).md)
- [dayOfYear(_:)](foundation/date/formatstyle/dayofyear(_:).md)
- [era(_:)](foundation/date/formatstyle/era(_:).md)
- [month(_:)](foundation/date/formatstyle/month(_:).md)
- [week(_:)](foundation/date/formatstyle/week(_:).md)
- [weekday(_:)](foundation/date/formatstyle/weekday(_:).md)
- [year(_:)](foundation/date/formatstyle/year(_:).md)
- [Date.FormatStyle.DateStyle](foundation/date/formatstyle/datestyle.md)
