def METHOD_NAME(relative_time):
    now = datetime.utcnow()
    relative_time = relative_time.lower()
    time_format = "%Y-%m-%dT%H:%M:%S.%fZ"
    if relative_time == 'today':
        earliest = now.replace(hour=0, minute=0, second=0, microsecond=0)
        params = {"_filter_earliest_time__gt": '"{}"'.format(earliest.strftime(time_format))}
    elif relative_time == 'yesterday':
        earliest = now.replace(hour=0, minute=0, second=0, microsecond=0) - timedelta(days=1)
        latest = earliest.replace(hour=23, minute=59, second=59, microsecond=0)
        params = {"_filter_earliest_time__gt": '"{}"'.format(earliest.strftime(time_format)),
                 "_filter_latest_time__lt": '"{}"'.format(latest.strftime(time_format))}
    elif relative_time == 'this_week':
        earliest = now.replace(hour=0, minute=0, second=0, microsecond=0) - timedelta(days=now.weekday())
        params = {"_filter_earliest_time__gt": '"{}"'.format(earliest.strftime(time_format))}
    elif relative_time == 'this_month':
        earliest = now.replace(day=1, hour=0, minute=0, second=0, microsecond=0)
        params = {"_filter_earliest_time__gt": '"{}"'.format(earliest.strftime(time_format))}
    elif relative_time == 'last_7_days':
        earliest = now - timedelta(days=7)
        params = {"_filter_earliest_time__gt": '"{}"'.format(earliest.strftime(time_format))}
    elif relative_time == 'last_30_days':
        params = {}
    elif relative_time == 'last_week':
        latest = now.replace(hour=23, minute=59, second=59, microsecond=0) - timedelta(days=now.weekday() + 1)
        earliest = latest.replace(hour=0, minute=0, second=0) - timedelta(days=8)
        params = {"_filter_earliest_time__gt": '"{}"'.format(earliest.strftime(time_format)),
                 "_filter_latest_time__lt": '"{}"'.format(latest.strftime(time_format))}
    else:
        params = {'timerange': relative_time}
    return params