def encode_timestamp(timestamp):
    """
    Encodes a timestamp as an ISO 8601 string.
    
    :param timestamp: A datetime object.
    :return: An ISO 8601 string.
    """
    return timestamp.strftime('%Y-%m-%dT%H:%M:%S.%f')
