How to get the start date and end date of a week, and also if the following dates below comes under a particular range of start and end dates of the week how to show only those weeks start and end date.I am using python 2.4
2011-03-07 0:27:41
2011-03-06 0:13:41
2011-03-05 0:17:40
2011-03-04 0:55:40
2011-05-16 0:55:40
2011-07-16 0:55:40
Now
returns the day of the week for the first date “as an integer, where Monday is 0 and Sunday is 6”, so selecting those dates for which
weekday() in [0, 6]will give you the start and end dates of weeks (or use 4 instead of 6 for work weeks).