def handle_returning_date_to_string(date_obj):
    """Gets date object to string"""
    # if the returning date is a string leave it as is.
    if isinstance(date_obj, str):
        return date_obj

    # if event time is datetime object - convert it to string.
    else:
        return date_obj.isoformat()