How long ago was king david?

The only record of King David's existence is the Hebrew Bible. Using that source he lived from about 1040 to 970 BCE