When will a day on Earth & Mars be the same length? I read on Wikipedia that:


  As on Earth, the period of rotation of Mars (the length of its day) is slowing down. However, this effect is three orders of magnitude smaller than on Earth because the gravitational effect of Phobos is negligible and the effect is mainly due to the Sun.[19] On Earth, the gravitational influence of the Moon has a much greater effect. Eventually, in the far future, the length of a day on Earth will equal and then exceed the length of a day on Mars.


So, how far into the future exactly will it be when the length of a day on Earth and Mars will be equal? Also, for how long will their day lengths be within say, one second of each other?

By "day", I mean the Mean Solar Day.
Since the rate of lengthening of the day on Mars is three orders of magnitude less than that of the Earth for a first go at calculating how long it will be before the day lengths are equal we can ignore the change in day length on Mars. The difference in day lengths is $\approx 40$ minutes. The Earths day lengthens by $\approx 1.7$ ms/100 years. Therefore the day lengths will be equal in: $\frac{40\times 60}{1.7\times 10^{-3}}\times 100 \approx 141 \times 10^6$ years