Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #friday #month
ADD COMMENT
Topic
Name
4+3 =