Add functions to get segments by time