When specifying a date:
datetime.datetime(2011, 8, 15)
How can i get to know that this is the third week of the month?
What if I wa
Maybe http://labix.org/python-dateutil will help.
Other than that it's just math.
from datetime import datetime, timedelta def week_of_month(date): month = date.month week = 0 while date.month == month: week += 1 date -= timedelta(days=7) return week