
Chop off the end of the string to make Python’s datetime.fromisoformat() accept datetime strings that end in “Z”:
datetime_obj = datetime.fromisoformat(input_time_str_var[:-1])
Background discussion and why this isn’t a thing:

Chop off the end of the string to make Python’s datetime.fromisoformat() accept datetime strings that end in “Z”:
datetime_obj = datetime.fromisoformat(input_time_str_var[:-1])
Background discussion and why this isn’t a thing: