def create_daily_schedule_details(api, api_exception, custom_interval, start_time):
    """ Creates a ScheduleDetails object for use with a scheduled task for daily execution using a custom interval.

    :param api: The Deep Security API modules.
    :param api_exception: The Deep Security API exception module.
    :param custom_interval: The interval between each run. For example, '2' will start a run every second day.
    :param start_time: The epoch time in milliseconds when the scheduled task first runs.
    :return: A ScheduleDetails object.
    """

    # Create a ScheduleDetails object and set the recurrence type
    daily_schedule = api.ScheduleDetails()
    daily_schedule.recurrence_type = "daily"

    # Specify when the task runs
    daily_schedule_parameters = api.DailyScheduleParameters()

    # Use a custom frequency type to run the task at daily intervals.
    # Every day and only weekdays are other available frequency types.
    daily_schedule_parameters.frequency_type = "custom"
    daily_schedule_parameters.custom_interval = custom_interval
    daily_schedule_parameters.start_time = start_time

    # Add the schedule parameters to the schedule details
    daily_schedule.daily_schedule_parameters = daily_schedule_parameters

    return daily_schedule