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

# week(_:)

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

## Declaration

```swift
func week(_ format: Date.FormatStyle.Symbol.Week = .defaultDigits) -> Date.FormatStyle
```

## Parameters

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

## Return Value

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

## Discussion

Discussion Possible values of Date.FormatStyle.Symbol.Week include defaultDigits, twoDigits, and weekOfMonth. This example shows a variety of Date.FormatStyle.Symbol.Week format styles applied to a date: let meetingDate = Date() // May 3, 2021 at 3:00 PM meetingDate.formatted(Date.FormatStyle().week(.defaultDigits)) // 19 meetingDate.formatted(Date.FormatStyle().week(.twoDigits)) // 19 meetingDate.formatted(Date.FormatStyle().week(.weekOfMonth)) // 2 meetingDate.formatted(Date.FormatStyle().week()) // 19

An incomplete week at the start of a month is the first week of the month 1. If you don’t provide a format, the defaultDigits 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)
- [quarter(_:)](foundation/date/formatstyle/quarter(_:).md)
- [weekday(_:)](foundation/date/formatstyle/weekday(_:).md)
- [year(_:)](foundation/date/formatstyle/year(_:).md)
- [Date.FormatStyle.DateStyle](foundation/date/formatstyle/datestyle.md)
