Returns a datetime object with optional params or today.

def _get_date(day=None, month=None, year=None):
    """Returns a datetime object with optional params or today."""

    now = datetime.date.today()
    if day is None:
        return now

    try:
        return datetime.date(
            day=int(day),
            month=int(month or now.month),
            year=int(year or now.year),
        )
    except ValueError as error:
        print("error: {0}".format(error), file=sys.stderr)