Although this is a simple $t=d/v$ calculation, where $v$ is the heliocentric velocity, $d$ the heliocentric distance and $t$ the travel time, one must use the velocity appropriate for current technology, which is Solar system escape through chemical rockets together with gravity-assisting planetary flybys. One must effectively use the velocity that the spacecraft will have at infinite distance from the Sun, when the conversion of its kinetic energy to gravitational potential energy is complete.
The above graph shows Voyager 2's heliocentric velocity (red) alongside the computed Sun-system escape velocity (blue) calculated from $\frac{1}{2}\,v_e^2 = \frac{G\,M_\odot}{r}$. One can see that, at 40 astronomical units, after all the flybys are done, and therefore after Voyager 2 has gotten all the kinetic energy it can from the assisting planets, the helocentric velocity is about $17.5{\rm km\,s^{-1}}$ whereas the escape velocity (essentially the gravitational potential deficit expressed as a kinetic energy) is $5{\rm km\,s^{-1}}$, thus the fraction of Voyager's kinetic energy leftover after achieving infinite separation from the Sun is $\frac{17.5^2 - 5^2}{17.5^2}$ and so the spaceship's velocity in this state will be:
$$\sqrt{\frac{17.5^2 - 5^2}{17.5^2}} \times 17.5=\sqrt{17.5^2 - 5^2}\approx 16.8{\rm km\,s^{-1}}$$
whence the travel time for 40 light years will be $40\times \frac{300\,000}{16.8}\approx 700\,000\,{\rm years}$.