Time-varying formation tracking control problems for the multi-UAV system are investigated in this paper, where a leader with dynamic input is considered. Based on the sliding mode control theory, continuous-time and discrete-time distributed formation tracking protocols are proposed by utilizing the neighboring relative information. Using Lyapunov stability approach, sufficient conditions for the multi-UAV system to achieve the desired formation tracking are given and the width of quasi-sliding mode domain for the discrete-time protocol is expressed. Algorithms to construct the designed continuous-time and discrete-time protocols for multi-UAV systems are provided. Based on the Gazebo simulator, a formation tracking virtual experiment platform for multi-UAV systems is constructed. Virtual experiments with multiple UAVs are performed to demonstrate the effectiveness of the continuous and discrete formation tracking protocols.