def salesforce_from_datetime(d):
    """Create a Salesforce-style ISO8601 string from a Python datetime"""
    return d.strftime("%Y-%m-%dT%H:%M:%S.{}+0000").format(
        str(d.microsecond)[:3].ljust(3, "0")
    )