import datetime as _datetime


def _get_last_day(datetime):
    """Return the start of the day before 'datetime', e.g.
    _get_last_day(April 1st) will return March 31st
    """

    datetime = datetime - _datetime.timedelta(days=1)
    return _datetime.datetime(
        year=datetime.year, month=datetime.month, day=datetime.day, tzinfo=datetime.tzinfo
    )