Answers for "python get third friday of the month"

0

python get third friday of the month

import calendar

c = calendar.Calendar(firstweekday=calendar.SUNDAY)

year = 2015; month = 2

monthcal = c.monthdatescalendar(year,month)
third_friday = [day for week in monthcal for day in week if \
                day.weekday() == calendar.FRIDAY and \
                day.month == month][2]
Posted by: Guest on April-04-2022

Code answers related to "python get third friday of the month"

Python Answers by Framework

Browse Popular Code Answers by Language