---
title: weekday
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsdatecomponents/weekday
---

# weekday

The number of the weekdays.

## Declaration

```swift
var weekday: Int { get set }
```

## Discussion

Discussion Weekday units are the numbers 1 through n, where n is the number of days in the week. For example, in the Gregorian calendar, n is 7 and Sunday is represented by 1. 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

- [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)
- [setWeek(_:)](foundation/nsdatecomponents/setweek(_:).md)
