code: def strftimegen(start_dt, end_dt):
      
      if start_dt > end_dt:
          raise ValueError("the start datetime is after the end datetime: (%r,%r)" % (start_dt, end_dt))
  
      def iterftime(string):
          date_subs = [i for i in DATE_FORMATS if i[1].search(string) is not None]
          if not date_subs:
              yield string
          else:
              dt = start_dt
              date_path = string
              while end_dt >= dt:
                  for item in date_subs:
                      date_path = item[1].sub(dt.strftime(item[0]), date_path)
                  yield date_path
                  dt = dt + datetime.timedelta(days=1)
  
      return iterftime
docs: Return a generator function for datetime format strings.
      The generator produce a day-by-day sequence starting from the first datetime
      to the second datetime argument.