The Earth and all the planets are formed 4.5 billion years ago with interstellar hydrogen gas and heavier elements previously formed in earlier stars that had exploded.