Isoweekday() Method Of Datetime Class In Python
Isoweekday() is a method of the DateTime class that tells the day of the given date. It returns an integer that corresponds to a particular day.
Return Value: It returns an integer which corresponds to a day as per the table
|Integer Returned||Day of the week|
Example 1: Print the day of the current date.
Today's date is : 2021-07-27 The date 2021-07-27 falls on Tuesday
Example 2: Get the day of the week for today’s date from 2010 to the current year
The 7/28 in the year 2010 has fallen on Wednesday
The 7/28 in the year 2011 has fallen on Thursday
The 7/28 in the year 2012 has fallen on Saturday
The 7/28 in the year 2013 has fallen on Sunday
The 7/28 in the year 2014 has fallen on Monday
The 7/28 in the year 2015 has fallen on Tuesday
The 7/28 in the year 2016 has fallen on Thursday
The 7/28 in the year 2017 has fallen on Friday
The 7/28 in the year 2018 has fallen on Saturday
The 7/28 in the year 2019 has fallen on Sunday
The 7/28 in the year 2020 has fallen on Tuesday
The 7/28 in the year 2021 has fallen on Wednesday
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course