code: def date_to_datetime(self, time_input, tz=None):
          
          dt = None
          try:
              # dt = parser.parse(time_input, fuzzy_with_tokens=True)[0]
              dt = parser.parse(time_input)
              # don't convert timezone if dt timezone already in the correct timezone
              if tz is not None and tz != dt.tzname():
                  if dt.tzinfo is None:
                      dt = self._replace_timezone(dt)
                  dt = dt.astimezone(timezone(tz))
          except IndexError:
              pass
          except TypeError:
              pass
          except ValueError:
              pass
          return dt
docs: Convert ISO 8601 and other date strings to datetime.datetime type.
  
          Args:
              time_input (string): The time input string (see formats above).
              tz (string): The time zone for the returned data.
  
          Returns:
              (datetime.datetime): Python datetime.datetime object.