In this master thesis, a UAV capable of navigating by 3D waypoints is modified to be able to navigate by 4D waypoints making it possible to set a specific arrival time for each waypoint. The UAV uses GPS to keep track of time and the memory management of each waypoint is altered to make space for a timestamp. The velocity is then updated continuously with the average velocity needed from the distance left to the waypoint divided by the time-to-go. Features to skip a waypoint if it's behind in schedule is added and safety limits for speeds that can be set by the pilot is implemented. The algorithm is tested with the open source ArduPilots software in the loop simulation with good results and then a flight test with a quadcopter is conducted where the previously simulated trajectories are flown. The flight test proves that the algorithm is good enough to arrive at a waypoint at specified time if the trajectory is set within the limits of the UAV, although it can experience hard deceleration if the average velocity rapidly changes between waypoints.