def get_date(mesg):
    """ Determine the publication date
        Keyword arguments:
        mesg: Crossref record
    """
    if 'published-print' in mesg:
        date = mesg['published-print']['date-parts'][0][0]
    elif 'published-online' in mesg:
        date = mesg['published-online']['date-parts'][0][0]
    elif 'posted' in mesg:
        date = mesg['posted']['date-parts'][0][0]
    else:
        date = 'unknown'
    return date