Mars lost its magnetic field 4.5 billion years ago according to this article:
Mars lost its global magnetic field during the time of this heightened activity. After 500 million years, the Martian atmosphere is substantially destroyed, all due to the disappearance of Mars global magnetic field.
When will the Earth lose its magnetic field and atmosphere?
I am wondering: how much time do we have to find another planet to live on?