I have two string variables which contain dates in yyyy-mm-dd format as follows :
date1 = \'2011-05-03\' date2 = \'2011-05-10\'
I want to write
import time def dates_between(start, end): start_epoch = int(time.mktime(time.strptime(start, "%Y-%m-%d"))) end_epoch = int(time.mktime(time.strptime(end, "%Y-%m-%d"))) + 1 #include end return range(start_epoch, end_epoch, 86400)