After forty years - From the change of the government, into a monarchy, which was about ten years before David began to reign. So this fell out about the thirtieth year of his reign.