Python get start and end date of the week -


how start date , end date of week, , if following dates below comes under particular range of start , end dates of week how show weeks start , end date.i 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 

from datetime import datetime time import strptime 

now

datetime(*strptime('2011-03-08  0:27:41', '%y-%m-%d  %h:%m:%s')[0:6]).weekday() 

returns day of week first date "as integer, monday 0 , sunday 6", selecting dates weekday() in [0, 6] give start , end dates of weeks (or use 4 instead of 6 work weeks).


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -