---
title: "setWeek(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsdatecomponents/setweek(_:)"
---

# setWeek(_:)

Sets the number of weeks.

## Declaration

```swift
func setWeek(_ v: Int)
```

## Parameters

- `v`: The number of week units.

## Discussion

Discussion This value is interpreted in the context of the calendar with which it is used—see Calendars, Date Components, and Calendar Units in Date and Time Programming Guide.

## See Also

### Accessing Weeks and Days

- [weekday](foundation/nsdatecomponents/weekday.md)
- [weekdayOrdinal](foundation/nsdatecomponents/weekdayordinal.md)
- [weekOfMonth](foundation/nsdatecomponents/weekofmonth.md)
- [weekOfYear](foundation/nsdatecomponents/weekofyear.md)
- [day](foundation/nsdatecomponents/day.md)
- [week()](foundation/nsdatecomponents/week().md)
