from datetime import datetime


def prior_month(dte):
    """
    Compute the datetime of the first day of the prior month.

    Argument:
        dte - a date
    """
    year = dte.year
    month = dte.month
    if month == 1:
        year -= 1
        month = 12
    else:
        month -= 1
    return datetime(year, month, 1)