return 0 if we are passed a type we don't recognise
Fix notice
Only call set_schedule_start_time if we have a start time