from datetime import datetime


def get_date_code(date_string):
    """
    Given date in Hansard date format:
        ie. Wednesday, December 4, 2019, Evening
    Convert to date code:
        ie. 04-12-2019-E
    """
    tok = date_string.split(', ')
    date = datetime.strptime(', '.join(tok[1:3]), "%B %d, %Y")
    return f'{date.strftime("%d-%m-%Y")}-{tok[-1][0]}'