def this_week(t):
 while 1:
  tm = time.localtime(t)
  if (tm.tm_wday == 0):
   break
  t -= DAY
 monday = (tm.tm_year, tm.tm_mon, tm.tm_mday, 0, 0, 0, 0, 0, tm.tm_isdst)
 return time.mktime(monday)

def this_week ( t ) : while 1 : tm = time . localtime ( t ) if ( tm . tm_wday == 0 ) : break t -= DAY monday = ( tm . tm_year , tm . tm_mon , tm . tm_mday , 0 , 0 , 0 , 0 , 0 , tm . tm_isdst ) return time . mktime ( monday )
return timestamp for start of this week .