We consider a time-dependent shortest path problem with possible waiting at each node and a global bound $W$ on the total waiting time. The goal is to minimize only the time travelled along the edges of the path, not including the waiting time. We prove that the problem can be solved in polynomial time when the travel time functions are piece-wise linear and continuous. The algorithm relies on a recurrence relation characterized by a bound $\omega$ for the total waiting time, where $0\leq \omega \leq W$. We show that only a small numbers of values $\omega_1,\omega_2,\ldots,\omega_K$ need to be considered, which depends on the total number of breakpoints of all travel time functions.