Check If The Given Date Is A Weekday Or Weekend

[Solved] Check If The Given Date Is A Weekday Or Weekend | Shell - Code Explorer | yomemimo.com
Question : #check if the given date is a weekday or weekend

Answered by : impossible-impala-2kf2sz6ngusb

#check if the given date is a weekday or weekend
from datetime import datetime
week_date = date(2022, 3, 3)
week_date.weekday() <= 4
True
from datetime import datetime
week_date = date(2022, 3, 6)
week_date.weekday() > 4
True

Source : | Last Update : Mon, 09 May 22

Answers related to check if the given date is a weekday or weekend

Code Explorer Popular Question For Shell