Days of the week Django
Question: please, explain me, how do this thing: I have a week number (52, for example)
and year (2012). So, how I can get the days number (monday - 24, tuesday - 25,
etc). Yes, I read [this](http://docs.python.org/2/library/datetime.html), but
I cant understand, how to do it.

Thanks.


Answer: I would do it like this:

    
    
    from datetime import date, timedelta
    
    def get_weekdays(year, week):
        january_first = date(year, 1, 1)
        monday_date = january_first + timedelta(days=week * 7 - january_first.weekday())
    
        # monday, tuesday, .. sunday
        return [(monday_date + timedelta(days=d)).day for d in range(7)]
    

(my weeks start at monday)

