Setting the weekday property with a value lower or higher will throw an error.
Datetime.weekday read/write property
The Datetime.weekday property returns a number representing the day of the week. Valid values are from 1 through 7.
- Sunday
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
Example
-- prints the current day of the week, for example "3" for Thursday
print(sys.Datetime().weekday)