def format_index(index, start, end):
 start -= start.utcoffset()
 end -= end.utcoffset()
 indexes = []
 while (start.date() <= end.date()):
  indexes.append(start.strftime(index))
  start += datetime.timedelta(days=1)
 return ','.join(indexes)

def format_index ( index , start , end ) : start -= start . utcoffset ( ) end -= end . utcoffset ( ) indexes = [ ] while ( start . date ( ) <= end . date ( ) ) : indexes . append ( start . strftime ( index ) ) start += datetime . timedelta ( days = 1 ) return ',' . join ( indexes )
takes an index .