def ensure_three_decimal_points_for_milliseconds_and_replace_z(
    datetimestring: str,
) -> str:
    """
    To convert SciHub Datetimes to Python Datetimes, we need them in ISO format
    SciHub Datetimes can have milliseconds of less than 3 digits therefore
    we pad them with zeros to the right to make 3 digits, as required by `datetime`
    We also need to replace Z at the end with +00:00
    :param datetimestring: Str representing a SciHub Datetime
    :returns: Str representing a correctly padded SciHub Datetime
    """
    datetimestring_stripped = datetimestring.replace("Z", "")
    try:
        number_of_decimal_points = len(datetimestring_stripped.split(".")[1])
        if number_of_decimal_points < 3:
            datetimestring_stripped = (
                f"{datetimestring_stripped}{(3 - number_of_decimal_points) * '0'}"
            )
    except IndexError:
        datetimestring_stripped = f"{datetimestring_stripped}.000"
    return f"{datetimestring_stripped}+00:00"