Actually, this is basically the same in 2D and 3D and it all follows directly from the definition of velocity.
velocity = distance / time, time = distance / velocity. All you need is the actual distance, which can be computed using vector subtraction (x2-x, y2-y) using the Pythagorean theorem: distance = sqrt(a^2+b^2). For 3D, you add the third dimension and are done.
Hi rnlf. Thanks for pointing me up! I have another question, how do i get X2, Y2 position depending of the given time, velocity, and distance? Do i need the slope of the line?