Intelligent Transportation Systems (ITS), such as Green Light Optimal Speed Advisory (GLOSA) systems, can be used to reduce the energy consumption in modern vehicles. In particular, GLOSA systems provide driving strategies that can decrease both energy consumption and travel time. In this paper, we present a new method to calculate the optimal driving speeds based on traffic light data. To this end, a detailed formulation for the optimization problem is presented for a multi-segment route, based on an electric vehicle (EV) and traffic light models in an urban environment. Since this formulation results in a nonconvex optimization problem, a relaxation procedure is applied with a low calculation time. By using this procedure, a dynamic real-time speed advisory algorithm is developed. Numerical simulations showed improved performance over benchmark techniques. In particular, the proposed Dynamic-GLOSA solution’s performance was shown to be very close to that with a brute-force optimal solution but with a much shorter calculation time and has significant potential for energy saving.